From a2eeaf30d50500ad21c01801b0efcbdb111657e8 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Sat, 24 May 2025 13:38:18 +0300 Subject: [PATCH 01/32] fromBytes function in ImageTools. current plan - deprecate loadFromFile, add more specific loading methods and do that via a new `formats` folder under the main `vision` folder --- src/vision/ds/Image.hx | 14 ++++++ src/vision/formats/ImageIO.hx | 14 ++++++ .../__internal}/FormatImageLoader.hx | 2 +- .../formats/__internal/JsImageLoader.js.hx | 35 +++++++++++++ src/vision/formats/from/From.hx | 15 ++++++ src/vision/formats/from/FromBytes.hx | 49 +++++++++++++++++++ src/vision/tools/ImageTools.hx | 47 ++++++++---------- 7 files changed, 148 insertions(+), 28 deletions(-) create mode 100644 src/vision/formats/ImageIO.hx rename src/vision/{helpers => formats/__internal}/FormatImageLoader.hx (98%) create mode 100644 src/vision/formats/__internal/JsImageLoader.js.hx create mode 100644 src/vision/formats/from/From.hx create mode 100644 src/vision/formats/from/FromBytes.hx diff --git a/src/vision/ds/Image.hx b/src/vision/ds/Image.hx index de07cce5..b7377b89 100644 --- a/src/vision/ds/Image.hx +++ b/src/vision/ds/Image.hx @@ -521,6 +521,20 @@ abstract Image(ByteArray) { return image.copyPixelFrom(cast this, x, y); } + /** + Copies an image's graphics data, while retaining this image's `ImageView` + + @param image The image to copy data from + @returns This image + **/ + public inline function copyImageFrom(image:Image):Image { + var currentView = getView(); + this.resize(image.underlying.length); + this.blit(0, image.underlying, 0, image.underlying.length); + setView(currentView); + return cast this; + } + /** Returns a portion of the image, specified by a rectangle. diff --git a/src/vision/formats/ImageIO.hx b/src/vision/formats/ImageIO.hx new file mode 100644 index 00000000..bbb595a4 --- /dev/null +++ b/src/vision/formats/ImageIO.hx @@ -0,0 +1,14 @@ +package vision.formats; + +import vision.formats.from.From; + +/** + A factory for loading/saving images to and from different file formats, frameworks and platforms. +**/ +class ImageIO { + + /** + Import a `vision.ds.Image` from different image formats + **/ + public static var from:From = new From(); +} \ No newline at end of file diff --git a/src/vision/helpers/FormatImageLoader.hx b/src/vision/formats/__internal/FormatImageLoader.hx similarity index 98% rename from src/vision/helpers/FormatImageLoader.hx rename to src/vision/formats/__internal/FormatImageLoader.hx index 33e68521..aa14821c 100644 --- a/src/vision/helpers/FormatImageLoader.hx +++ b/src/vision/formats/__internal/FormatImageLoader.hx @@ -1,4 +1,4 @@ -package vision.helpers; +package vision.formats.__internal; #if format import haxe.io.BytesInput; import vision.ds.Image; diff --git a/src/vision/formats/__internal/JsImageLoader.js.hx b/src/vision/formats/__internal/JsImageLoader.js.hx new file mode 100644 index 00000000..326d3134 --- /dev/null +++ b/src/vision/formats/__internal/JsImageLoader.js.hx @@ -0,0 +1,35 @@ +package vision.formats.__internal; + +import vision.ds.Image; + +class JsImageLoader { + + public static function loadAsync(path:String, source:Image, callback:(Image) -> Void) { + var imgElement = js.Browser.document.createImageElement(); + imgElement.src = path; + imgElement.crossOrigin = "Anonymous"; + imgElement.onload = () -> { + var canvas = js.Browser.document.createCanvasElement(); + + canvas.width = imgElement.width; + canvas.height = imgElement.height; + + canvas.getContext2d().drawImage(imgElement, 0, 0); + + if (source == null) source = new Image(imgElement.width, imgElement.height); + + var imageData = canvas.getContext2d().getImageData(0, 0, source.width, source.height); + + var i = 0; + while (i < imageData.data.length) { + for (o in 0...4) { + source.underlying[i + (@:privateAccess Image.OFFSET + 1) + o] = imageData.data[i + o]; + } + i += 4; + } + + callback(source); + } + } + +} \ No newline at end of file diff --git a/src/vision/formats/from/From.hx b/src/vision/formats/from/From.hx new file mode 100644 index 00000000..c62f1196 --- /dev/null +++ b/src/vision/formats/from/From.hx @@ -0,0 +1,15 @@ +package vision.formats.from; + +/** + A container class for image loader types +**/ +@:noCompletion class From { + + public function new() {} + + /** + Load an image from bytes + **/ + public var bytes:FromBytes = new FromBytes(); + +} \ No newline at end of file diff --git a/src/vision/formats/from/FromBytes.hx b/src/vision/formats/from/FromBytes.hx new file mode 100644 index 00000000..112abd74 --- /dev/null +++ b/src/vision/formats/from/FromBytes.hx @@ -0,0 +1,49 @@ +package vision.formats.from; + +import vision.exceptions.LibraryRequired; +import vision.ds.Image; +import vision.exceptions.Unimplemented; +import vision.ds.ByteArray; + +/** + A class for loading images from bytes. +**/ +@:noCompletion class FromBytes { + + public function new() {} + + /** + Loads an image from `PNG` bytes + + @param bytes The image's bytes + @throws ImageLoadingFailed if the loaded image is not a PNG + @throws ImageLoadingFailed if the PNG has incorrect header data + @throws LibraryRequired if used without installing & including `format` + @return the loaded image + **/ + public function png(bytes:ByteArray):Image { + #if format + return vision.formats.__internal.FormatImageLoader.png(bytes); + #else + throw new LibraryRequired("format", [], "vision.formats.from.FromBytes.png", "function"); + #end + } + + /** + Loads an image from `BMP` bytes + + @param bytes The image's bytes + @throws ImageLoadingFailed if the loaded image is not a BMP + @throws ImageLoadingFailed if the BMP has incorrect header data, and reports it has more bytes than it should. + @throws LibraryRequired if used without installing & including `format` + @return the loaded image + **/ + public function bmp(bytes:ByteArray):Image { + #if format + return vision.formats.__internal.FormatImageLoader.bmp(bytes); + #else + throw new LibraryRequired("format", [], "vision.formats.from.FromBytes.bmp", "function"); + #end + + } +} \ No newline at end of file diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index adc69be5..684cbd4b 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -1,7 +1,8 @@ package vision.tools; +import vision.formats.ImageIO; #if format -import vision.helpers.FormatImageLoader; +import vision.formats.__internal.FormatImageLoader; #end import haxe.io.Path; import haxe.crypto.Base64; @@ -16,10 +17,9 @@ import vision.exceptions.Unimplemented; import vision.exceptions.WebResponseError; import vision.ds.ImageResizeAlgorithm; #if js -import js.lib.Promise; import js.Browser; import js.html.CanvasElement; - +import vision.formats.__internal.JsImageLoader; #end import haxe.ds.Vector; import vision.ds.IntPoint2D; @@ -115,33 +115,26 @@ class ImageTools { #end #end #else - var imgElement = js.Browser.document.createImageElement(); - imgElement.src = path; - imgElement.crossOrigin = "Anonymous"; - imgElement.onload = () -> { - var canvas = js.Browser.document.createCanvasElement(); - - canvas.width = imgElement.width; - canvas.height = imgElement.height; - - canvas.getContext2d().drawImage(imgElement, 0, 0); - - if (image == null) image = new Image(imgElement.width, imgElement.height); - - var imageData = canvas.getContext2d().getImageData(0, 0, image.width, image.height); + JsImageLoader.loadAsync(path, image, onComplete); + #end + } - var i = 0; - while (i < imageData.data.length) { - for (o in 0...4) { - image.underlying[i + (@:privateAccess Image.OFFSET + 1) + o] = imageData.data[i + o]; - } - i += 4; + public static function fromBytes(?image:Image, bytes:ByteArray, fileFormat:ImageFormat):Image { + image = image == null ? new Image(0, 0) : image; + image.copyImageFrom( + switch fileFormat { + case PNG: ImageIO.from.bytes.png(bytes); + case BMP: ImageIO.from.bytes.bmp(bytes); + default: { + #if !vision_quiet + throw new Unimplemented('Using `ImageTools.fromBytes` with a file of type `${fileFormat}`'); + #end + ImageIO.from.bytes.png(bytes); + } } + ); - if(onComplete != null) - onComplete(image); - } - #end + return image; } /** From 1bda5ad91ab07b167a62dbdb4c69805a83773814 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Sat, 24 May 2025 21:48:48 +0300 Subject: [PATCH 02/32] added js image loading technique,notice that they are spin-looping, so a native impl should always be preferred --- .../formats/__internal/JsImageLoader.js.hx | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/vision/formats/__internal/JsImageLoader.js.hx b/src/vision/formats/__internal/JsImageLoader.js.hx index 326d3134..7173075c 100644 --- a/src/vision/formats/__internal/JsImageLoader.js.hx +++ b/src/vision/formats/__internal/JsImageLoader.js.hx @@ -1,7 +1,18 @@ package vision.formats.__internal; +import haxe.io.Path; +import vision.exceptions.WebResponseError; +import vision.exceptions.ImageLoadingFailed; +import js.lib.Promise; +import js.Browser; +import js.html.URL; +import js.lib.Uint8Array; +import js.html.Blob; +import vision.ds.ByteArray; import vision.ds.Image; +using StringTools; + class JsImageLoader { public static function loadAsync(path:String, source:Image, callback:(Image) -> Void) { @@ -32,4 +43,65 @@ class JsImageLoader { } } + public static function loadURLSync(url:String):Image { + var img = Browser.document.createImageElement(); + + img.src = url; + + var promiseStatus = 2; + var promise = new Promise((resolve, reject) -> { + img.onload = () -> { + resolve(img); + promiseStatus = 1; + }; + img.onerror = (e) -> { + reject(e); + promiseStatus = 0; + }; + }); + + while (promiseStatus == 2) { + Browser.window.requestAnimationFrame(null); + } + + URL.revokeObjectURL(url); + + if (promiseStatus == 0) { + throw new WebResponseError(img.src, "Failed to load image"); + } + + var canvas = Browser.document.createCanvasElement(); + canvas.width = img.width; + canvas.height = img.height; + canvas.getContext2d().drawImage(img, 0, 0); + var imageData = canvas.getContext2d().getImageData(0, 0, img.width, img.height); + + var visionImage = new Image(img.width, img.height); + var i = 0; + while (i < imageData.data.length) { + for (o in 0...4) { + visionImage.underlying[@:privateAccess Image.OFFSET + 1 + i + o] = imageData.data[i + o]; + } + i += 4; + } + + + return visionImage; + } + + public static function loadBytesSync(bytes:ByteArray, fileType:String):Image { + var blob = new Blob([Uint8Array.from(bytes)], { type: fileType }); + var url = URL.createObjectURL(blob); + return loadURLSync(url); + } + + public static function loadFileSync(filePath:String):Image { + if (!filePath.startsWith("file:///")) { + filePath = Path.normalize(filePath); + filePath = "file:///" + filePath; + } + + return loadURLSync(filePath); + } + } \ No newline at end of file From 47395143aaa453e2a5916f7fb8fda8346342ba86 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Sat, 24 May 2025 21:54:15 +0300 Subject: [PATCH 03/32] support for RAW and JPEG in load function, CI should fail --- src/vision/ds/ImageFormat.hx | 10 ++++++++++ src/vision/formats/from/FromBytes.hx | 12 ++++++++++++ src/vision/tools/ImageTools.hx | 2 ++ 3 files changed, 24 insertions(+) diff --git a/src/vision/ds/ImageFormat.hx b/src/vision/ds/ImageFormat.hx index 7633e3f9..fedba5e2 100644 --- a/src/vision/ds/ImageFormat.hx +++ b/src/vision/ds/ImageFormat.hx @@ -14,4 +14,14 @@ enum abstract ImageFormat(Int) { BMP encoding **/ var BMP; + + /** + JPEG encoding + **/ + var JPEG; + + /** + Raw `vision.ds.Image` bytes + **/ + var RAW; } \ No newline at end of file diff --git a/src/vision/formats/from/FromBytes.hx b/src/vision/formats/from/FromBytes.hx index 112abd74..c6d09d26 100644 --- a/src/vision/formats/from/FromBytes.hx +++ b/src/vision/formats/from/FromBytes.hx @@ -24,6 +24,8 @@ import vision.ds.ByteArray; public function png(bytes:ByteArray):Image { #if format return vision.formats.__internal.FormatImageLoader.png(bytes); + #elseif js + return vision.formats.__internal.JsImageLoader.loadBytesSync(bytes, "image/png"); #else throw new LibraryRequired("format", [], "vision.formats.from.FromBytes.png", "function"); #end @@ -41,9 +43,19 @@ import vision.ds.ByteArray; public function bmp(bytes:ByteArray):Image { #if format return vision.formats.__internal.FormatImageLoader.bmp(bytes); + #elseif js + return vision.formats.__internal.JsImageLoader.loadBytesSync(bytes, "image/bmp"); #else throw new LibraryRequired("format", [], "vision.formats.from.FromBytes.bmp", "function"); #end } + + public function jpeg(bytes:ByteArray):Image { + #if js + return vision.formats.__internal.JsImageLoader.loadBytesSync(bytes, "image/jpeg"); + #else + throw new Unimplemented('vision.formats.from.FromBytes.jpeg'); + #end + } } \ No newline at end of file diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index 684cbd4b..d6c4bfdb 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -123,8 +123,10 @@ class ImageTools { image = image == null ? new Image(0, 0) : image; image.copyImageFrom( switch fileFormat { + case RAW: cast bytes; case PNG: ImageIO.from.bytes.png(bytes); case BMP: ImageIO.from.bytes.bmp(bytes); + case JPEG: ImageIO.from.bytes.jpeg(bytes); default: { #if !vision_quiet throw new Unimplemented('Using `ImageTools.fromBytes` with a file of type `${fileFormat}`'); From 1cc1997c8d97633522d5bf39735e0c214543ad35 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Sun, 25 May 2025 01:17:27 +0300 Subject: [PATCH 04/32] further integration of new from methods: fromURL and fromFile. need the `to` department, and maybe a local implementation of jpeg reading --- compile.hxml | 4 +-- src/vision/ds/ImageFormat.hx | 9 +++++++ src/vision/tools/ImageTools.hx | 47 ++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/compile.hxml b/compile.hxml index c13817ec..45f3b7f1 100644 --- a/compile.hxml +++ b/compile.hxml @@ -12,8 +12,8 @@ #--define compile_unit_tests #--define radix_test ---js bin/main.js -# --interp +# --js bin/main.js +--interp # --define simple_tests # --define feature_detection_tests # --define draw_tests diff --git a/src/vision/ds/ImageFormat.hx b/src/vision/ds/ImageFormat.hx index fedba5e2..74e9fd99 100644 --- a/src/vision/ds/ImageFormat.hx +++ b/src/vision/ds/ImageFormat.hx @@ -24,4 +24,13 @@ enum abstract ImageFormat(Int) { Raw `vision.ds.Image` bytes **/ var RAW; + + @:from public static function fromString(type:String) { + return switch type.toLowerCase() { + case "png": PNG; + case "bmp": BMP; + case "jpeg" | "jpg": JPEG; + default: RAW; + } + } } \ No newline at end of file diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index d6c4bfdb..3a1b0378 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -1,5 +1,9 @@ package vision.tools; +#if sys +import sys.io.File; +#end +import haxe.Http; import vision.formats.ImageIO; #if format import vision.formats.__internal.FormatImageLoader; @@ -139,6 +143,49 @@ class ImageTools { return image; } + public static function fromFile(?image:Image, path:String):Image { + #if js + return image.copyImageFrom(JsImageLoader.loadFileSync(path)); + #else + return fromBytes(image, File.getBytes(path), Path.extension(path)); + #end + } + + public static function fromURL(?image:Image, url:String):Image { + #if js + return image.copyImageFrom(JsImageLoader.loadURLSync(url, null)); + #else + var http = new Http(url); + var requestStatus = 2; + http.onBytes = (data) -> { + fromBytes(image, data, Path.extension(url)); + requestStatus = 1; + } + http.onError = (msg) -> { + #if !vision_quiet + throw new WebResponseError(url, msg); + #end + requestStatus = 0; + } + http.request(); + + while (requestStatus == 2) { + #if sys + Sys.sleep(0.1); + #end + // This is a busy loop. Pretty bad, but there isn't really a better way. + } + + if (requestStatus == 0) { + #if !vision_quiet + throw new WebResponseError(url, "Failed to load image"); + #end + } + + return image; + #end + } + /** Saves an image to a path. From 911acbca8d9838f7643719cb562409b193ffcf7e Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Mon, 26 May 2025 18:29:38 +0300 Subject: [PATCH 05/32] Js & format lib methods for exporting images to different formats (bmp/png/jpeg) --- compile.hxml | 4 +- .../formats/__internal/FormatImageExporter.hx | 82 +++++++++++++++++++ .../formats/__internal/JsImageExporter.js.hx | 31 +++++++ 3 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 src/vision/formats/__internal/FormatImageExporter.hx create mode 100644 src/vision/formats/__internal/JsImageExporter.js.hx diff --git a/compile.hxml b/compile.hxml index 45f3b7f1..c13817ec 100644 --- a/compile.hxml +++ b/compile.hxml @@ -12,8 +12,8 @@ #--define compile_unit_tests #--define radix_test -# --js bin/main.js ---interp +--js bin/main.js +# --interp # --define simple_tests # --define feature_detection_tests # --define draw_tests diff --git a/src/vision/formats/__internal/FormatImageExporter.hx b/src/vision/formats/__internal/FormatImageExporter.hx new file mode 100644 index 00000000..ee0bf44f --- /dev/null +++ b/src/vision/formats/__internal/FormatImageExporter.hx @@ -0,0 +1,82 @@ +package vision.formats.__internal; + +import vision.ds.PixelFormat; +#if format +import vision.ds.ByteArray; +import haxe.io.BytesOutput; +import vision.ds.Image; +import vision.ds.ImageFormat; +import vision.exceptions.ImageSavingFailed; +import format.png.Writer as PngWriter; +import format.png.Tools as PngTools; +import format.bmp.Writer as BmpWriter; +import format.bmp.Tools as BmpTools; +import format.jpg.Writer as JpegWriter; +import format.jpg.Data as JpegData; + +@:access(vision.ds.Image) +class FormatImageExporter { + + /** + Exports an image to `PNG` + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + **/ + public static function png(image:Image):ByteArray { + try { + var output = new BytesOutput(); + var writer = new PngWriter(output); + var data = PngTools.build32ARGB(image.width, image.height, image.underlying.sub(Image.OFFSET, image.underlying.length - Image.OFFSET)); + writer.write(data); + return output.getBytes(); + } catch (e) { + throw new ImageSavingFailed(ImageFormat.PNG, e.message); + } + } + + /** + Exports an image to `JPEG` + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + **/ + public static function bmp(image:Image):ByteArray { + try { + var output = new BytesOutput(); + var writer = new BmpWriter(output); + var data = BmpTools.buildFromARGB(image.width, image.height, image.underlying.sub(Image.OFFSET, image.underlying.length - Image.OFFSET)); + writer.write(data); + return output.getBytes(); + } catch (e) { + throw new ImageSavingFailed(ImageFormat.BMP, e.message); + } + } + + /** + Exports an image to `JPEG` + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + **/ + public static function jpeg(image:Image):ByteArray { + try { + var output = new BytesOutput(); + var writer = new JpegWriter(output); + var rawPixelData = PixelFormat.convertPixelFormat(image.underlying.sub(Image.OFFSET, image.underlying.length - Image.OFFSET), PixelFormat.ARGB, PixelFormat.RGB); + writer.write({ + pixels: rawPixelData, + width: image.width, + height: image.height, + quality: 1.0 + }); + return output.getBytes(); + } catch (e) { + throw new ImageSavingFailed(ImageFormat.JPEG, e.message); + } + } +} +#end diff --git a/src/vision/formats/__internal/JsImageExporter.js.hx b/src/vision/formats/__internal/JsImageExporter.js.hx new file mode 100644 index 00000000..cad90173 --- /dev/null +++ b/src/vision/formats/__internal/JsImageExporter.js.hx @@ -0,0 +1,31 @@ +package vision.formats.__internal; + +import haxe.crypto.Base64; +import haxe.io.Bytes; +import vision.ds.ByteArray; +import haxe.io.Path; +import js.Browser; +import vision.ds.Image; + +using vision.tools.ImageTools; +using StringTools; + +class JsImageExporter { + + public static function saveToFileAsync(image:Image, path:String, streamType:String) { + var canvas = image.toJsCanvas(); + var i = canvas.toDataURL(streamType, 1.0).replace(streamType, "image/octet-stream"); + var link = Browser.document.createAnchorElement(); + link.download = new Path(path).file + ".png"; + link.href = i; + link.click(); + } + + public static function saveToBytesSync(image:Image, streamType:String):ByteArray { + var canvas = image.toJsCanvas(); + var dataURL = canvas.toDataURL(streamType, 1.0); + var base64Data = dataURL.substring(dataURL.indexOf(",") + 1); + return Base64.decode(base64Data); + + } +} \ No newline at end of file From 49c3cb251432aeae789580b9b2c31ceccb253f28 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Tue, 27 May 2025 14:35:44 +0300 Subject: [PATCH 06/32] Added `To`, `ToBytes` and their respective methods/property with integration into ImageTools --- src/vision/formats/ImageIO.hx | 6 + .../formats/__internal/JsImageExporter.js.hx | 22 +++- src/vision/formats/to/To.hx | 15 +++ src/vision/formats/to/ToBytes.hx | 67 +++++++++++ src/vision/tools/ImageTools.hx | 111 +++++++----------- 5 files changed, 147 insertions(+), 74 deletions(-) create mode 100644 src/vision/formats/to/To.hx create mode 100644 src/vision/formats/to/ToBytes.hx diff --git a/src/vision/formats/ImageIO.hx b/src/vision/formats/ImageIO.hx index bbb595a4..75072a24 100644 --- a/src/vision/formats/ImageIO.hx +++ b/src/vision/formats/ImageIO.hx @@ -1,6 +1,7 @@ package vision.formats; import vision.formats.from.From; +import vision.formats.to.To; /** A factory for loading/saving images to and from different file formats, frameworks and platforms. @@ -11,4 +12,9 @@ class ImageIO { Import a `vision.ds.Image` from different image formats **/ public static var from:From = new From(); + + /** + Export a `vision.ds.Image` to different image formats + **/ + public static var to:To = new To(); } \ No newline at end of file diff --git a/src/vision/formats/__internal/JsImageExporter.js.hx b/src/vision/formats/__internal/JsImageExporter.js.hx index cad90173..862b6898 100644 --- a/src/vision/formats/__internal/JsImageExporter.js.hx +++ b/src/vision/formats/__internal/JsImageExporter.js.hx @@ -1,5 +1,6 @@ package vision.formats.__internal; +import vision.ds.ImageFormat; import haxe.crypto.Base64; import haxe.io.Bytes; import vision.ds.ByteArray; @@ -12,12 +13,15 @@ using StringTools; class JsImageExporter { - public static function saveToFileAsync(image:Image, path:String, streamType:String) { + public static function saveToFileAsync(image:Image, path:String, format:ImageFormat) { var canvas = image.toJsCanvas(); - var i = canvas.toDataURL(streamType, 1.0).replace(streamType, "image/octet-stream"); + var streamType = imageFormatToStreamType(format); + var href = format != RAW ? + canvas.toDataURL(streamType, 1.0).replace(streamType, "application/octet-stream") : + 'data:application/octet-stream;base64,' + Base64.encode(saveToBytesSync(image, streamType)); var link = Browser.document.createAnchorElement(); - link.download = new Path(path).file + ".png"; - link.href = i; + link.download = Path.withoutDirectory(path); + link.href = href; link.click(); } @@ -28,4 +32,14 @@ class JsImageExporter { return Base64.decode(base64Data); } + + public static function imageFormatToStreamType(format:ImageFormat):String { + return switch format { + case PNG: "image/png"; + case JPEG: "image/jpeg"; + case BMP: "image/bmp"; + case RAW: "application/octet-stream"; + } + } + } \ No newline at end of file diff --git a/src/vision/formats/to/To.hx b/src/vision/formats/to/To.hx new file mode 100644 index 00000000..89e2e2a0 --- /dev/null +++ b/src/vision/formats/to/To.hx @@ -0,0 +1,15 @@ +package vision.formats.to; + +/** + A container class for image saver types +**/ +@:noCompletion class To { + + public function new() {} + + /** + Save an image to bytes + **/ + public var bytes:ToBytes = new ToBytes(); + +} \ No newline at end of file diff --git a/src/vision/formats/to/ToBytes.hx b/src/vision/formats/to/ToBytes.hx new file mode 100644 index 00000000..0e22cf4c --- /dev/null +++ b/src/vision/formats/to/ToBytes.hx @@ -0,0 +1,67 @@ +package vision.formats.to; + +import vision.ds.ByteArray; +import vision.ds.Image; + +/** + A class for saving images to bytes +**/ +@:noCompletion class ToBytes { + + public function new() {} + + /** + Exports an image to `PNG` bytes + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + @throws LibraryRequired if used without installing & including `format` on non-`js` targets + **/ + public function png(image:Image):ByteArray { + #if format + return vision.formats.__internal.FormatImageExporter.png(image); + #elseif js + return vision.formats.__internal.JsImageExporter.saveToBytesSync(image, "image/png"); + #else + throw new LibraryRequired("format", [], "vision.formats.to.ToBytes.png", "function"); + #end + } + + /** + Exports an image to `BMP` bytes + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + @throws LibraryRequired if used without installing & including `format` on non-`js` targets + **/ + public function bmp(image:Image):ByteArray { + #if format + return vision.formats.__internal.FormatImageExporter.bmp(image); + #elseif js + return vision.formats.__internal.JsImageExporter.saveToBytesSync(image, "image/bmp"); + #else + throw new LibraryRequired("format", [], "vision.formats.to.ToBytes.bmp", "function"); + #end + } + + /** + Exports an image to `JPEG` bytes + + @param image The image to export + @return The bytes of the exported image + @throws ImageSavingFailed If something goes wrong (for example, the image is invalid or device is out of memory) + @throws LibraryRequired if used without installing & including `format` on non-`js` targets + **/ + public function jpeg(image:Image):ByteArray { + #if format + return vision.formats.__internal.FormatImageExporter.jpeg(image); + #elseif js + return vision.formats.__internal.JsImageExporter.saveToBytesSync(image, "image/jpeg"); + #else + throw new LibraryRequired("format", [], "vision.formats.to.ToBytes.jpeg", "function"); + #end + } + +} \ No newline at end of file diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index 3a1b0378..a5e02517 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -24,6 +24,7 @@ import vision.ds.ImageResizeAlgorithm; import js.Browser; import js.html.CanvasElement; import vision.formats.__internal.JsImageLoader; +import vision.formats.__internal.JsImageExporter; #end import haxe.ds.Vector; import vision.ds.IntPoint2D; @@ -122,7 +123,28 @@ class ImageTools { JsImageLoader.loadAsync(path, image, onComplete); #end } + + /** + Saves an image to a path. + + **Note: this function requires the `format` library, and only supports PNG.** + + To install: + + `haxelib install format` + + + @param image The image to save + @param pathWithFileName The path to save to + @param saveFormat An image format. + @throws LibraryRequired Thrown when used without installing & including `format` + @throws ImageSavingFailed Thrown when trying to save a corrupted image. + **/ + public static function saveToFile(image:Image, pathWithFileName:String, saveFormat:ImageFormat = PNG) { + return toFile(image, pathWithFileName, saveFormat); + } + public static function fromBytes(?image:Image, bytes:ByteArray, fileFormat:ImageFormat):Image { image = image == null ? new Image(0, 0) : image; image.copyImageFrom( @@ -153,7 +175,7 @@ class ImageTools { public static function fromURL(?image:Image, url:String):Image { #if js - return image.copyImageFrom(JsImageLoader.loadURLSync(url, null)); + return image.copyImageFrom(JsImageLoader.loadURLSync(url)); #else var http = new Http(url); var requestStatus = 2; @@ -186,78 +208,27 @@ class ImageTools { #end } - /** - Saves an image to a path. - - **Note: this function requires the `format` library, and only supports PNG.** - - To install: - - `haxelib install format` - - - @param image The image to save - @param pathWithFileName The path to save to - @param saveFormat An image format. - @throws LibraryRequired Thrown when used without installing & including `format` - @throws ImageSavingFailed Thrown when trying to save a corrupted image. - **/ - public static function saveToFile(image:Image, pathWithFileName:String, saveFormat:ImageFormat = PNG) { - #if (!js) - #if format - switch saveFormat { - case PNG: { - try { - final out = sys.io.File.write(pathWithFileName); - var writer = new format.png.Writer(out); - final data = format.png.Tools.build32ARGB(image.width, image.height, image.underlying.sub(Image.OFFSET, image.underlying.length - Image.OFFSET)); - writer.write(data); - out.close(); - } catch (e:haxe.Exception) { - #if !vision_quiet - throw new ImageSavingFailed(saveFormat, e.message); - #end - } - } - case BMP: { - #if !vision_quiet - throw new Unimplemented('Using `ImageTools.saveToFile` with `BMP` format'); - #end - } - } - #else + public static function toBytes(?image:Image, format:ImageFormat) { + image = image == null ? new Image(0, 0) : image; + return switch format { + case RAW: image.underlying; + case PNG: ImageIO.to.bytes.png(image); + case BMP: ImageIO.to.bytes.bmp(image); + case JPEG: ImageIO.to.bytes.jpeg(image); + default: { #if !vision_quiet - throw new LibraryRequired("format", [], "ImageTools.loadFromFile", "function"); + throw new Unimplemented('Using `ImageTools.toBytes` with a file of type `${format}`'); #end - #end - #else - #if format - switch saveFormat { - case PNG: { - try { - var canvas = image.toJsCanvas(); - var i = canvas.toDataURL("image/png", 1.0).replace("image/png", "image/octet-stream"); - var link = Browser.document.createAnchorElement(); - link.download = new Path(pathWithFileName).file + ".png"; - link.href = i; - link.click(); - } catch (e:haxe.Exception) { - #if !vision_quiet - throw new ImageSavingFailed(saveFormat, e.message); - #end - } - } - case BMP: { - #if !vision_quiet - throw new Unimplemented('Using `ImageTools.saveToFile` with `BMP` format'); - #end - } + ImageIO.to.bytes.png(image); } - #else - #if !vision_quiet - throw new LibraryRequired("format", [], "ImageTools.loadFromFile", "function"); - #end - #end + }; + } + + public static function toFile(image:Image, pathWithFileName:String, format:ImageFormat = PNG) { + #if js + JsImageExporter.saveToFileAsync(image, pathWithFileName, format); + #else + File.saveBytes(pathWithFileName, toBytes(image, format)); #end } From b0188e8dc7d11ff7cf35f0634c20de70760cf5ab Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Tue, 27 May 2025 15:40:09 +0300 Subject: [PATCH 07/32] FromFramework, copied framework IO to a seperate file --- .../formats/__internal/FrameworkImageIO.hx | 257 ++++++++++++++++++ src/vision/formats/from/From.hx | 5 + src/vision/formats/from/FromFramework.hx | 58 ++++ 3 files changed, 320 insertions(+) create mode 100644 src/vision/formats/__internal/FrameworkImageIO.hx create mode 100644 src/vision/formats/from/FromFramework.hx diff --git a/src/vision/formats/__internal/FrameworkImageIO.hx b/src/vision/formats/__internal/FrameworkImageIO.hx new file mode 100644 index 00000000..f6a6df8b --- /dev/null +++ b/src/vision/formats/__internal/FrameworkImageIO.hx @@ -0,0 +1,257 @@ +package vision.formats.__internal; + +import vision.ds.Image; +import vision.ds.ByteArray; + +@:access(vision.ds.Image) +class FrameworkImageIO { + #if flixel + public static function fromFlxSprite(sprite:flixel.FlxSprite):Image { + var image = new Image(Std.int(sprite.width), Std.int(sprite.height)); + if (sprite.pixels == null) { + lime.utils.Log.warn("ImageTools.fromFlxSprite() - The given sprite's bitmapData is null. An empty image is returned. Is the given FlxSprite not added?"); + return image; + } + for (x in 0...Std.int(sprite.width)) { + for (y in 0...Std.int(sprite.height)) { + image.setPixel(x, y, sprite.pixels.getPixel(x, y)); + } + } + return image; + } + + public static function toFlxSprite(image:Image):flixel.FlxSprite { + var sprite = new flixel.FlxSprite(0, 0); + sprite.makeGraphic(image.width, image.height, 0x00ffffff); + for (x in 0...image.width) { + for (y in 0...image.height) { + sprite.pixels.setPixel(x, y, image.getPixel(x, y)); + } + } + return sprite; + } + #end + + #if (openfl || flash) + public static function fromBitmapData(bitmapData:flash.display.BitmapData):Image { + var image = new Image(bitmapData.width, bitmapData.height); + for (x in 0...bitmapData.width) { + for (y in 0...bitmapData.height) { + image.setPixel(x, y, bitmapData.getPixel32(x, y)); + } + } + return image; + } + + public static function toBitmapData(image:Image):flash.display.BitmapData { + var bitmapData = new flash.display.BitmapData(image.width, image.height, true, 0x00000000); + for (x in 0...image.width) { + for (y in 0...image.height) { + bitmapData.setPixel32(x, y, image.getPixel(x, y)); + } + } + return bitmapData; + } + + public static function fromSprite(sprite:flash.display.Sprite):Image { + var bmp = new flash.display.BitmapData(Std.int(sprite.width), Std.int(sprite.height)); + bmp.draw(sprite); + return fromBitmapData(bmp); + } + + public static function toSprite(image:Image):flash.display.Sprite { + final bmp = toBitmapData(image); + var s = new flash.display.Sprite(); + s.addChild(new flash.display.Bitmap(bmp)); + return s; + } + + public static function fromShape(shape:flash.display.Shape):Image { + var bmp = new flash.display.BitmapData(Std.int(shape.width), Std.int(shape.height)); + bmp.draw(shape); + return fromBitmapData(bmp); + } + #end + + #if openfl + public static function toShape(image:Image):flash.display.Shape { + var s:openfl.display.Shape = cast toSprite(image); + var sh = new openfl.display.Shape(); + sh.graphics.drawGraphicsData(s.graphics.readGraphicsData()); + return sh; + } + #end + + #if lime + public static function fromLimeImage(limeImage:lime.graphics.Image):Image { + var image = new Image(limeImage.width, limeImage.height); + for (x in 0...image.width) { + for (y in 0...image.height) { + image.setPixel(x, y, limeImage.getPixel(x, y)); + } + } + return image; + } + + public static function toLimeImage(image:Image):lime.graphics.Image { + var limeImage = new lime.graphics.Image(image.width, image.height); + for (x in 0...image.width) { + for (y in 0...image.height) { + limeImage.setPixel(x, y, image.getPixel(x, y)); + } + } + return limeImage; + } + #end + + #if kha + public static function fromKhaImage(khaImage:kha.Image):Image { + var image = new Image(khaImage.width, khaImage.height); + for (x in 0...image.width) { + for (y in 0...image.height) { + image.setPixel(x, y, khaImage.at(x, y)); + } + } + return image; + } + #end + + #if heaps + public static function fromHeapsPixels(pixels:hxd.Pixels):Image { + var image = new Image(pixels.width, pixels.height); + switch pixels.format { + case ARGB: + default: + #if !vision_quiet + throw "pixels format must be in ARGB format, currently: " + pixels.format; + #else + return image; + #end + } + for (x in 0...pixels.width) { + for (y in 0...pixels.height) { + image.setPixel(x, y, pixels.getPixel(x, y)); + } + } + return image; + } + + public static function toHeapsPixels(image:Image):hxd.Pixels { + var pixels = hxd.Pixels.alloc(image.width, image.height, ARGB); + for (x in 0...image.width) { + for (y in 0...pixels.height) { + pixels.setPixel(x, y, image.getPixel(x, y)); + } + } + return pixels; + } + #end + #if js + public static function fromJsCanvas(canvas:js.html.CanvasElement):Image { + var image:Image = Image.fromBytes(new ByteArray(Image.OFFSET + (canvas.width + canvas.height) * 4), canvas.width, canvas.height); + + final imageData = canvas.getContext2d().getImageData(0, 0, image.width, image.height); + + { + var i = 0; + while (i < imageData.data.length) { + for (o in 0...4) + image.underlying[i + (Image.OFFSET + 1) + o] = imageData.data[i + o]; + i += 4; + } + } + + return image; + } + + public static function toJsCanvas(image:Image):js.html.CanvasElement { + var c = js.Browser.document.createCanvasElement(); + + c.width = image.width; + c.height = image.height; + + var ctx = c.getContext2d(); + final imageData = ctx.getImageData(0, 0, image.width, image.height); + var data = imageData.data; + for (x in 0...image.width) { + for (y in 0...image.height) { + var i = (y * image.width + x) * 4; + for (o in 0...4) + data[i + o] = image.underlying[i + (Image.OFFSET + 1) + o]; + } + } + + ctx.putImageData(imageData, 0, 0); + + return c; + } + + public static function fromJsImage(image:js.html.ImageElement):Image { + var canvas = js.Browser.document.createCanvasElement(); + canvas.width = image.width; + canvas.height = image.height; + canvas.getContext2d().drawImage(image, 0, 0); + return fromJsCanvas(canvas); + } + + public static function toJsImage(image:Image):js.html.ImageElement { + var canvas = image.toJsCanvas(); + var htmlImage = js.Browser.document.createImageElement(); + htmlImage.src = canvas.toDataURL(); + return htmlImage; + } + #end + #if (haxeui_core && (haxeui_flixel || haxeui_openfl || haxeui_heaps || haxeui_html5)) + public static function fromHaxeUIImage(image:haxe.ui.components.Image):Image { + #if haxeui_flixel + return fromFlxSprite(image.resource); + #elseif haxeui_openfl + return fromBitmapData(image.resource); + #elseif haxeui_heaps + return fromHeapsPixels(image.resource); + #else + return fromJsImage(image.resource); + #end + } + + public static function toHaxeUIImage(image:Image):haxe.ui.components.Image { + var huiImage = new haxe.ui.components.Image(); + huiImage.width = image.width; + huiImage.height = image.height; + #if haxeui_flixel + huiImage.resource = toFlxSprite(image); + #elseif haxeui_openfl + huiImage.resource = toBitmapData(image); + #elseif haxeui_heaps + huiImage.resource = toHeapsPixels(image); + #else + huiImage.resource = toJsImage(image); + #end + return huiImage; + } + + public static function fromHaxeUIImageData(image:haxe.ui.backend.ImageData):Image { + #if haxeui_flixel + return fromFlxSprite(image); + #elseif haxeui_openfl + return fromBitmapData(image); + #elseif haxeui_heaps + return fromHeapsPixels(image); + #else + return fromJsImage(image); + #end + } + + public static function toHaxeUIImageData(image:Image):haxe.ui.backend.ImageData { + #if haxeui_flixel + return toFlxSprite(image); + #elseif haxeui_openfl + return fromBitmapData(image); + #elseif haxeui_heaps + return toHeapsPixels(image); + #else + return toJsImage(image); + #end + } + #end +} \ No newline at end of file diff --git a/src/vision/formats/from/From.hx b/src/vision/formats/from/From.hx index c62f1196..eb2719de 100644 --- a/src/vision/formats/from/From.hx +++ b/src/vision/formats/from/From.hx @@ -12,4 +12,9 @@ package vision.formats.from; **/ public var bytes:FromBytes = new FromBytes(); + /** + Convert an image from a specific framework's image type to `vision.ds.Image` + **/ + public var framework:FromFramework = new FromFramework(); + } \ No newline at end of file diff --git a/src/vision/formats/from/FromFramework.hx b/src/vision/formats/from/FromFramework.hx new file mode 100644 index 00000000..7302df52 --- /dev/null +++ b/src/vision/formats/from/FromFramework.hx @@ -0,0 +1,58 @@ +package vision.formats.from; + +import vision.formats.__internal.FrameworkImageIO; + +/** + A class for loading images from different frameworks +**/ +@:noCompletion class FromFramework { + + #if js + public var js = { + canvas: (canvas:js.html.CanvasElement) -> FrameworkImageIO.fromJsCanvas(canvas), + image: (image:js.html.ImageElement) -> FrameworkImageIO.fromJsImage(image) + } + #end + #if flixel + public var flixel = { + flxsprite: (sprite:flixel.FlxSprite) -> FrameworkImageIO.fromFlxSprite(sprite) + } + #end + #if flash + public var flash = { + bitmapdata: (bitmapData:flash.display.BitmapData) -> FrameworkImageIO.fromBitmapData(bitmapData), + sprite: (sprite:flash.display.Sprite) -> FrameworkImageIO.fromSprite(sprite), + shape: (shape:flash.display.Shape) -> FrameworkImageIO.fromShape(shape) + } + #end + #if openfl + public var openfl = { + bitmapdata: (bitmapData:openfl.display.BitmapData) -> FrameworkImageIO.fromBitmapData(bitmapData), + sprite: (sprite:openfl.display.Sprite) -> FrameworkImageIO.fromSprite(sprite), + shape: (shape:openfl.display.Shape) -> FrameworkImageIO.fromShape(shape) + } + #end + #if lime + public var lime = { + image: (image:lime.graphics.Image) -> FrameworkImageIO.fromLimeImage(bitmapData) + } + #end + #if heaps + public var heaps = { + pixels: (pixels:hxd.Pixels) -> FrameworkImageIO.fromHeapsPixels(pixels) + } + #end + #if kha + public var kha = { + image: (image:kha.Image) -> FrameworkImageIO.fromKhaImage(image) + } + #end + #if (haxeui_core && (haxeui_flixel || haxeui_openfl || haxeui_heaps || haxeui_html5)) + public var haxeui = { + image: (image:haxe.ui.components.Image) -> FrameworkImageIO.fromHaxeUIImage(image), + imagedata: (imageData:haxe.ui.backend.ImageData) -> FrameworkImageIO.fromHaxeUIImageData(imageData) + } + #end + + public function new() {} +} \ No newline at end of file From 46fd6128a0b915da2ad60a01b16b1eeffb1b6b06 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Tue, 27 May 2025 15:59:47 +0300 Subject: [PATCH 08/32] To methods for frameworks, integration into ImageIO --- .vscode/settings.json | 3 ++ src/VisionMain.hx | 2 + src/vision/formats/to/To.hx | 4 ++ src/vision/formats/to/ToFramework.hx | 58 ++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 src/vision/formats/to/ToFramework.hx diff --git a/.vscode/settings.json b/.vscode/settings.json index 825caf94..77d274f1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,7 @@ "ARGB", "Bezier", "BGRA", + "bitmapdata", "bitmask", "blit", "Blitting", @@ -33,6 +34,7 @@ "fceil", "ffloor", "Flixel", + "flxsprite", "frameworking", "fround", "grayscale", @@ -45,6 +47,7 @@ "haxeui", "hxml", "ifies", + "imagedata", "interp", "Ints", "kernal", diff --git a/src/VisionMain.hx b/src/VisionMain.hx index 8d63d3b5..64eade12 100644 --- a/src/VisionMain.hx +++ b/src/VisionMain.hx @@ -1,5 +1,6 @@ package; +import vision.formats.ImageIO; import vision.algorithms.SimpleHough; import vision.ds.Matrix2D; import vision.ds.Color; @@ -35,6 +36,7 @@ using vision.tools.MathTools; printImage(image); printImage(image.filterForColorChannel(RED)); + #if simple_tests printSectionDivider("Simple image manipulation"); start = haxe.Timer.stamp(); diff --git a/src/vision/formats/to/To.hx b/src/vision/formats/to/To.hx index 89e2e2a0..c2336962 100644 --- a/src/vision/formats/to/To.hx +++ b/src/vision/formats/to/To.hx @@ -12,4 +12,8 @@ package vision.formats.to; **/ public var bytes:ToBytes = new ToBytes(); + /** + Convert an image to a specific framework's image type + **/ + public var framework:ToFramework = new ToFramework(); } \ No newline at end of file diff --git a/src/vision/formats/to/ToFramework.hx b/src/vision/formats/to/ToFramework.hx new file mode 100644 index 00000000..489ef3e0 --- /dev/null +++ b/src/vision/formats/to/ToFramework.hx @@ -0,0 +1,58 @@ +package vision.formats.to; + +import vision.ds.Image; +import vision.formats.__internal.FrameworkImageIO; + +/** + A class for saving images to different frameworks +**/ +@:noCompletion class ToFramework { + #if js + public var js = { + canvas: (image:Image) -> FrameworkImageIO.toJsCanvas(image), + image: (image:Image) -> FrameworkImageIO.toJsImage(image) + } + #end + #if flixel + public var flixel = { + flxsprite: (image:Image) -> FrameworkImageIO.toFlxSprite(image) + } + #end + #if flash + public var flash = { + bitmapdata: (image:Image) -> FrameworkImageIO.toBitmapData(image), + sprite: (image:Image) -> FrameworkImageIO.toSprite(image), + shape: (image:Image) -> FrameworkImageIO.toShape(image) + } + #end + #if openfl + public var openfl = { + bitmapdata: (image:Image) -> FrameworkImageIO.toBitmapData(image), + sprite: (image:Image) -> FrameworkImageIO.toSprite(image), + shape: (image:Image) -> FrameworkImageIO.toShape(image) + } + #end + #if lime + public var lime = { + image: (image:Image) -> FrameworkImageIO.toLimeImage(image) + } + #end + #if heaps + public var heaps = { + pixels: (image:Image) -> FrameworkImageIO.toHeapsPixels(image) + } + #end + #if kha + public var kha = { + image: (image:Image) -> FrameworkImageIO.toKhaImage(image) + } + #end + #if (haxeui_core && (haxeui_flixel || haxeui_openfl || haxeui_heaps || haxeui_html5)) + public var haxeui = { + image: (image:Image) -> FrameworkImageIO.toHaxeUIImage(image), + imagedata: (image:Image) -> FrameworkImageIO.toHaxeUIImageData(image) + } + #end + + public function new() {} +} \ No newline at end of file From e9e316f7eb34bbf96186c3a610f2e45007e61b41 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Tue, 27 May 2025 17:17:41 +0300 Subject: [PATCH 09/32] Removed ImageTools.from/to references, as well as the functions. --- src/vision/ds/Image.hx | 47 ++++--- src/vision/tools/ImageTools.hx | 250 --------------------------------- 2 files changed, 24 insertions(+), 273 deletions(-) diff --git a/src/vision/ds/Image.hx b/src/vision/ds/Image.hx index b7377b89..ceb5cf94 100644 --- a/src/vision/ds/Image.hx +++ b/src/vision/ds/Image.hx @@ -1,5 +1,6 @@ package vision.ds; +import vision.formats.ImageIO; import vision.algorithms.GaussJordan; import vision.ds.Matrix2D; import haxe.Resource; @@ -1437,95 +1438,95 @@ abstract Image(ByteArray) { //-------------------------------------------------------------------------- #if flixel @:to public function toFlxSprite():flixel.FlxSprite { - return ImageTools.toFlxSprite(cast this); + return ImageIO.to.framework.flixel.flxsprite(cast this); } @:from public static function fromFlxSprite(sprite:flixel.FlxSprite):Image { - return ImageTools.fromFlxSprite(sprite); + return ImageIO.from.framework.flixel.flxsprite(sprite); } #end - #if openfl + #if (openfl || flash) @:to public function toBitmapData():flash.display.BitmapData { - return ImageTools.toBitmapData(cast this); + return ImageIO.to.framework.flash.bitmapdata(cast this); } @:from public static function fromBitmapData(bitmapData:flash.display.BitmapData):Image { - return ImageTools.fromBitmapData(bitmapData); + return ImageIO.from.framework.flash.bitmapdata(bitmapData); } - @:to public function toShape():openfl.display.Shape { - return ImageTools.toShape(cast this); + @:to public function toShape():flash.display.Shape { + return ImageIO.to.framework.flash.shape(cast this); } @:from public static function fromShape(shape:flash.display.Shape):Image { - return ImageTools.fromShape(shape); + return ImageIO.from.framework.flash.shape(shape); } @:to public function toSprite():flash.display.Sprite { - return ImageTools.toSprite(cast this); + return ImageIO.to.framework.flash.sprite(cast this); } @:from public static function fromSprite(sprite:flash.display.Sprite):Image { - return ImageTools.fromSprite(sprite); + return ImageIO.from.framework.flash.sprite(sprite); } #end #if lime @:to public function toLimeImage():lime.graphics.Image { - return ImageTools.toLimeImage(cast this); + return ImageIO.to.framework.lime.image(cast this); } @:from public static function fromLimeImage(image:lime.graphics.Image):Image { - return ImageTools.fromLimeImage(image); + return ImageIO.from.framework.lime.image(image); } #end #if kha @:from public static function fromKhaImage(image:kha.Image):Image { - return ImageTools.fromKhaImage(image); + return ImageIO.from.framework.kha.image(image); } #end #if heaps @:from public static function fromHeapsPixels(pixels:hxd.Pixels):Image { - return ImageTools.fromHeapsPixels(pixels); + return ImageIO.from.framework.heaps.pixels(pixels); } @:to public function toHeapsPixels():hxd.Pixels { - return ImageTools.toHeapsPixels(cast this); + return ImageIO.to.framework.heaps.pixels(cast this); } #end #if js @:from public static function fromJsCanvas(canvas:js.html.CanvasElement):Image { - return ImageTools.fromJsCanvas(canvas); + return ImageIO.from.framework.js.canvas(canvas); } @:to public function toJsCanvas():js.html.CanvasElement { - return ImageTools.toJsCanvas(cast this); + return ImageIO.to.framework.js.canvas(cast this); } @:from public static function fromJsImage(image:js.html.ImageElement):Image { - return ImageTools.fromJsImage(image); + return ImageIO.from.framework.js.image(image); } @:to public function toJsImage():js.html.ImageElement { - return ImageTools.toJsImage(cast this); + return ImageIO.to.framework.js.image(cast this); } #end #if haxeui_core @:from public static function fromHaxeUIImage(image:haxe.ui.components.Image):Image { - return ImageTools.fromHaxeUIImage(image); + return ImageIO.from.framework.haxeui.image(image); } @:to public function toHaxeUIImage():haxe.ui.components.Image { - return ImageTools.toHaxeUIImage(cast this); + return ImageIO.to.framework.haxeui.image(cast this); } @:from public static function fromHaxeUIImageData(image:haxe.ui.backend.ImageData):Image { - return ImageTools.fromHaxeUIImageData(image); + return ImageIO.from.framework.haxeui.imagedata(image); } @:to public function toHaxeUIImageData():haxe.ui.backend.ImageData { - return ImageTools.toHaxeUIImageData(cast this); + return ImageIO.to.framework.haxeui.imagedata(cast this); } #end diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index a5e02517..822f8b04 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -326,256 +326,6 @@ class ImageTools { + pixel.green + pixel.blue) / 3) #end; return Color.fromRGBA(gray, gray, gray, pixel.alpha); } - - #if flixel - public static function fromFlxSprite(sprite:flixel.FlxSprite):Image { - var image = new Image(Std.int(sprite.width), Std.int(sprite.height)); - if (sprite.pixels == null) { - lime.utils.Log.warn("ImageTools.fromFlxSprite() - The given sprite's bitmapData is null. An empty image is returned. Is the given FlxSprite not added?"); - return image; - } - for (x in 0...Std.int(sprite.width)) { - for (y in 0...Std.int(sprite.height)) { - image.setPixel(x, y, sprite.pixels.getPixel(x, y)); - } - } - return image; - } - - public static function toFlxSprite(image:Image):flixel.FlxSprite { - var sprite = new flixel.FlxSprite(0, 0); - sprite.makeGraphic(image.width, image.height, 0x00ffffff); - for (x in 0...image.width) { - for (y in 0...image.height) { - sprite.pixels.setPixel(x, y, image.getPixel(x, y)); - } - } - return sprite; - } - #end - - #if (openfl || flash) - public static function fromBitmapData(bitmapData:flash.display.BitmapData):Image { - var image = new Image(bitmapData.width, bitmapData.height); - for (x in 0...bitmapData.width) { - for (y in 0...bitmapData.height) { - image.setPixel(x, y, bitmapData.getPixel32(x, y)); - } - } - return image; - } - - public static function toBitmapData(image:Image):flash.display.BitmapData { - var bitmapData = new flash.display.BitmapData(image.width, image.height, true, 0x00000000); - for (x in 0...image.width) { - for (y in 0...image.height) { - bitmapData.setPixel32(x, y, image.getPixel(x, y)); - } - } - return bitmapData; - } - - public static function fromSprite(sprite:flash.display.Sprite):Image { - var bmp = new flash.display.BitmapData(Std.int(sprite.width), Std.int(sprite.height)); - bmp.draw(sprite); - return fromBitmapData(bmp); - } - - public static function toSprite(image:Image):flash.display.Sprite { - final bmp = toBitmapData(image); - var s = new flash.display.Sprite(); - s.addChild(new flash.display.Bitmap(bmp)); - return s; - } - - public static function fromShape(shape:flash.display.Shape):Image { - var bmp = new flash.display.BitmapData(Std.int(shape.width), Std.int(shape.height)); - bmp.draw(shape); - return fromBitmapData(bmp); - } - #end - - #if openfl - public static function toShape(image:Image):flash.display.Shape { - var s:openfl.display.Shape = cast toSprite(image); - var sh = new openfl.display.Shape(); - sh.graphics.drawGraphicsData(s.graphics.readGraphicsData()); - return sh; - } - #end - - #if lime - public static function fromLimeImage(limeImage:lime.graphics.Image):Image { - var image = new Image(limeImage.width, limeImage.height); - for (x in 0...image.width) { - for (y in 0...image.height) { - image.setPixel(x, y, limeImage.getPixel(x, y)); - } - } - return image; - } - - public static function toLimeImage(image:Image):lime.graphics.Image { - var limeImage = new lime.graphics.Image(image.width, image.height); - for (x in 0...image.width) { - for (y in 0...image.height) { - limeImage.setPixel(x, y, image.getPixel(x, y)); - } - } - return limeImage; - } - #end - - #if kha - public static function fromKhaImage(khaImage:kha.Image):Image { - var image = new Image(khaImage.width, khaImage.height); - for (x in 0...image.width) { - for (y in 0...image.height) { - image.setPixel(x, y, khaImage.at(x, y)); - } - } - return image; - } - #end - - #if heaps - public static function fromHeapsPixels(pixels:hxd.Pixels):Image { - var image = new Image(pixels.width, pixels.height); - switch pixels.format { - case ARGB: - default: - #if !vision_quiet - throw "pixels format must be in ARGB format, currently: " + pixels.format; - #else - return image; - #end - } - for (x in 0...pixels.width) { - for (y in 0...pixels.height) { - image.setPixel(x, y, pixels.getPixel(x, y)); - } - } - return image; - } - - public static function toHeapsPixels(image:Image):hxd.Pixels { - var pixels = hxd.Pixels.alloc(image.width, image.height, ARGB); - for (x in 0...image.width) { - for (y in 0...pixels.height) { - pixels.setPixel(x, y, image.getPixel(x, y)); - } - } - return pixels; - } - #end - #if js - public static function fromJsCanvas(canvas:js.html.CanvasElement):Image { - var image:Image = Image.fromBytes(new ByteArray(Image.OFFSET + (canvas.width + canvas.height) * 4), canvas.width, canvas.height); - - final imageData = canvas.getContext2d().getImageData(0, 0, image.width, image.height); - - { - var i = 0; - while (i < imageData.data.length) { - for (o in 0...4) - image.underlying[i + (Image.OFFSET + 1) + o] = imageData.data[i + o]; - i += 4; - } - } - - return image; - } - - public static function toJsCanvas(image:Image):js.html.CanvasElement { - var c = js.Browser.document.createCanvasElement(); - - c.width = image.width; - c.height = image.height; - - var ctx = c.getContext2d(); - final imageData = ctx.getImageData(0, 0, image.width, image.height); - var data = imageData.data; - for (x in 0...image.width) { - for (y in 0...image.height) { - var i = (y * image.width + x) * 4; - for (o in 0...4) - data[i + o] = image.underlying[i + (Image.OFFSET + 1) + o]; - } - } - - ctx.putImageData(imageData, 0, 0); - - return c; - } - - public static function fromJsImage(image:js.html.ImageElement):Image { - var canvas = js.Browser.document.createCanvasElement(); - canvas.width = image.width; - canvas.height = image.height; - canvas.getContext2d().drawImage(image, 0, 0); - return fromJsCanvas(canvas); - } - - public static function toJsImage(image:Image):js.html.ImageElement { - var canvas = image.toJsCanvas(); - var htmlImage = js.Browser.document.createImageElement(); - htmlImage.src = canvas.toDataURL(); - return htmlImage; - } - #end - #if (haxeui_core && (haxeui_flixel || haxeui_openfl || haxeui_heaps || haxeui_html5)) - public static function fromHaxeUIImage(image:haxe.ui.components.Image):Image { - #if haxeui_flixel - return fromFlxSprite(image.resource); - #elseif haxeui_openfl - return fromBitmapData(image.resource); - #elseif haxeui_heaps - return fromHeapsPixels(image.resource); - #else - return fromJsImage(image.resource); - #end - } - - public static function toHaxeUIImage(image:Image):haxe.ui.components.Image { - var huiImage = new haxe.ui.components.Image(); - huiImage.width = image.width; - huiImage.height = image.height; - #if haxeui_flixel - huiImage.resource = toFlxSprite(image); - #elseif haxeui_openfl - huiImage.resource = toBitmapData(image); - #elseif haxeui_heaps - huiImage.resource = toHeapsPixels(image); - #else - huiImage.resource = toJsImage(image); - #end - return huiImage; - } - - public static function fromHaxeUIImageData(image:haxe.ui.backend.ImageData):Image { - #if haxeui_flixel - return fromFlxSprite(image); - #elseif haxeui_openfl - return fromBitmapData(image); - #elseif haxeui_heaps - return fromHeapsPixels(image); - #else - return fromJsImage(image); - #end - } - - public static function toHaxeUIImageData(image:Image):haxe.ui.backend.ImageData { - #if haxeui_flixel - return toFlxSprite(image); - #elseif haxeui_openfl - return fromBitmapData(image); - #elseif haxeui_heaps - return toHeapsPixels(image); - #else - return toJsImage(image); - #end - } - #end } private class NeighborsIterator { From ddf47363955ad931cd8670847a6e58d11da8426f Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Wed, 28 May 2025 11:01:33 +0300 Subject: [PATCH 10/32] Changelog and stuff --- CHANGELOG.md | 17 +++++++++++++++++ src/vision/ds/ImageFormat.hx | 4 ++-- .../formats/__internal/JsImageExporter.js.hx | 4 ++-- src/vision/tools/ImageTools.hx | 4 ++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1077c478..0c4d1b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 2.1.1 + +### `Image.hx` + - **Added `Image.copyImageFrom`** + +### `vision.ds` + - **Added `ImageFormat.JPEG`, `ImageFormat.VISION`** + +### `vision.tools` + - **Added `fromFile`, `fromURL` and `fromBytes` methods to `ImageTools`** + - **Added `toFile`, `toBytes` methods to `ImageTools`** + +### `vision.formats` + - **New Subdirectory inside the `vision` package for cleaner image format conversions** + - **Added `ImageIO` - reads/writes images from/to different formats/frameworks** + - **Added support for `jpeg` encoding for non-js platforms using `format`** + # 2.1.0 ### `Vision.hx` diff --git a/src/vision/ds/ImageFormat.hx b/src/vision/ds/ImageFormat.hx index 74e9fd99..5a73a4d2 100644 --- a/src/vision/ds/ImageFormat.hx +++ b/src/vision/ds/ImageFormat.hx @@ -23,14 +23,14 @@ enum abstract ImageFormat(Int) { /** Raw `vision.ds.Image` bytes **/ - var RAW; + var VISION; @:from public static function fromString(type:String) { return switch type.toLowerCase() { case "png": PNG; case "bmp": BMP; case "jpeg" | "jpg": JPEG; - default: RAW; + default: VISION; } } } \ No newline at end of file diff --git a/src/vision/formats/__internal/JsImageExporter.js.hx b/src/vision/formats/__internal/JsImageExporter.js.hx index 862b6898..3c1b87a2 100644 --- a/src/vision/formats/__internal/JsImageExporter.js.hx +++ b/src/vision/formats/__internal/JsImageExporter.js.hx @@ -16,7 +16,7 @@ class JsImageExporter { public static function saveToFileAsync(image:Image, path:String, format:ImageFormat) { var canvas = image.toJsCanvas(); var streamType = imageFormatToStreamType(format); - var href = format != RAW ? + var href = format != VISION ? canvas.toDataURL(streamType, 1.0).replace(streamType, "application/octet-stream") : 'data:application/octet-stream;base64,' + Base64.encode(saveToBytesSync(image, streamType)); var link = Browser.document.createAnchorElement(); @@ -38,7 +38,7 @@ class JsImageExporter { case PNG: "image/png"; case JPEG: "image/jpeg"; case BMP: "image/bmp"; - case RAW: "application/octet-stream"; + case VISION: "application/octet-stream"; } } diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index 822f8b04..c15f02fe 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -149,7 +149,7 @@ class ImageTools { image = image == null ? new Image(0, 0) : image; image.copyImageFrom( switch fileFormat { - case RAW: cast bytes; + case VISION: cast bytes; case PNG: ImageIO.from.bytes.png(bytes); case BMP: ImageIO.from.bytes.bmp(bytes); case JPEG: ImageIO.from.bytes.jpeg(bytes); @@ -211,7 +211,7 @@ class ImageTools { public static function toBytes(?image:Image, format:ImageFormat) { image = image == null ? new Image(0, 0) : image; return switch format { - case RAW: image.underlying; + case VISION: image.underlying; case PNG: ImageIO.to.bytes.png(image); case BMP: ImageIO.to.bytes.bmp(image); case JPEG: ImageIO.to.bytes.jpeg(image); From a9bfa1edfba3cef4ed0ab3f99640b92ec9c66244 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Wed, 28 May 2025 13:44:08 +0300 Subject: [PATCH 11/32] some little fixes here and there + renames --- CHANGELOG.md | 8 +++++-- src/vision/algorithms/ImageHashing.hx | 2 +- src/vision/ds/Image.hx | 6 +++--- .../formats/__internal/FrameworkImageIO.hx | 6 ++---- src/vision/tools/ImageTools.hx | 21 ++++++++++--------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c4d1b66..73bca14c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,12 @@ - **Added `ImageFormat.JPEG`, `ImageFormat.VISION`** ### `vision.tools` - - **Added `fromFile`, `fromURL` and `fromBytes` methods to `ImageTools`** - - **Added `toFile`, `toBytes` methods to `ImageTools`** + - **Added `ImageTools.loadFromFile` (synchronous version)** + - **Added `ImageTools.loadFromBytes`** + - **Added `ImageTools.loadFromURL`** + - **Added `ImageTools.exportToBytes`** + - **Added `ImageTools.exportToFile`** + - **Deprecated `ImageTools.saveToFile` in favor of `ImageTools.exportToFile`** ### `vision.formats` - **New Subdirectory inside the `vision` package for cleaner image format conversions** diff --git a/src/vision/algorithms/ImageHashing.hx b/src/vision/algorithms/ImageHashing.hx index 09cd2307..c2adf184 100644 --- a/src/vision/algorithms/ImageHashing.hx +++ b/src/vision/algorithms/ImageHashing.hx @@ -32,7 +32,7 @@ class ImageHashing { } } - return clone.toBytes(); + return clone.exportToBytes(); } public static function phash(image:Image):ByteArray { diff --git a/src/vision/ds/Image.hx b/src/vision/ds/Image.hx index ceb5cf94..bed62e6a 100644 --- a/src/vision/ds/Image.hx +++ b/src/vision/ds/Image.hx @@ -1599,7 +1599,7 @@ abstract Image(ByteArray) { @param width The width of the returned image. @param height Optional, the height of the returned image. determined automatically, can be overridden by setting this parameter **/ - public static inline function fromBytes(bytes:ByteArray, width:Int, ?height:Int) { + public static inline function loadFromBytes(bytes:ByteArray, width:Int, ?height:Int) { var h = height != null ? height : (bytes.length / 4 / width).ceil(); var array = new ByteArray(width * h * 4 + OFFSET); array.fill(0, array.length, 0); @@ -1619,7 +1619,7 @@ abstract Image(ByteArray) { Returns a `ByteArray` of format `ARGB` of the pixels of this image. @return A new `ByteArray` **/ - @:to overload public extern inline function toBytes():ByteArray { + @:to overload public extern inline function exportToBytes():ByteArray { return underlying.sub(OFFSET, underlying.length - OFFSET); } @@ -1628,7 +1628,7 @@ abstract Image(ByteArray) { @param colorFormat The wanted color format of the returned `ByteArray`. @return A new `ByteArray` **/ - overload public extern inline function toBytes(?colorFormat:PixelFormat = ARGB) { + overload public extern inline function exportToBytes(?colorFormat:PixelFormat = ARGB) { return inline PixelFormat.convertPixelFormat(underlying.sub(OFFSET, underlying.length - OFFSET), ARGB, colorFormat); } diff --git a/src/vision/formats/__internal/FrameworkImageIO.hx b/src/vision/formats/__internal/FrameworkImageIO.hx index f6a6df8b..476ab036 100644 --- a/src/vision/formats/__internal/FrameworkImageIO.hx +++ b/src/vision/formats/__internal/FrameworkImageIO.hx @@ -9,7 +9,7 @@ class FrameworkImageIO { public static function fromFlxSprite(sprite:flixel.FlxSprite):Image { var image = new Image(Std.int(sprite.width), Std.int(sprite.height)); if (sprite.pixels == null) { - lime.utils.Log.warn("ImageTools.fromFlxSprite() - The given sprite's bitmapData is null. An empty image is returned. Is the given FlxSprite not added?"); + lime.utils.Log.warn("FrameworkImageIO.fromFlxSprite() - The given sprite's bitmapData is null. An empty image is returned. Is the given FlxSprite not added?"); return image; } for (x in 0...Std.int(sprite.width)) { @@ -124,8 +124,6 @@ class FrameworkImageIO { default: #if !vision_quiet throw "pixels format must be in ARGB format, currently: " + pixels.format; - #else - return image; #end } for (x in 0...pixels.width) { @@ -148,7 +146,7 @@ class FrameworkImageIO { #end #if js public static function fromJsCanvas(canvas:js.html.CanvasElement):Image { - var image:Image = Image.fromBytes(new ByteArray(Image.OFFSET + (canvas.width + canvas.height) * 4), canvas.width, canvas.height); + var image:Image = Image.loadFromBytes(new ByteArray(Image.OFFSET + (canvas.width + canvas.height) * 4), canvas.width, canvas.height); final imageData = canvas.getContext2d().getImageData(0, 0, image.width, image.height); diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index c15f02fe..7dd96581 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -71,7 +71,7 @@ class ImageTools { @throws WebResponseError Thrown when a file loading attempt from a URL fails. @throws Unimplemented Thrown when used with unsupported file types. **/ - public static function loadFromFile(?image:Image, path:String, ?onComplete:Image->Void) { + public static overload extern inline function loadFromFile(?image:Image, path:String, ?onComplete:Image->Void) { #if (!js) #if format var func:ByteArray -> Image; @@ -140,12 +140,13 @@ class ImageTools { @throws LibraryRequired Thrown when used without installing & including `format` @throws ImageSavingFailed Thrown when trying to save a corrupted image. **/ + @:deprecated("ImageTools.saveToFile() is deprecated. use ImageTools.exportToFile() instead") public static function saveToFile(image:Image, pathWithFileName:String, saveFormat:ImageFormat = PNG) { - return toFile(image, pathWithFileName, saveFormat); + return exportToFile(image, pathWithFileName, saveFormat); } - public static function fromBytes(?image:Image, bytes:ByteArray, fileFormat:ImageFormat):Image { + public static function loadFromBytes(?image:Image, bytes:ByteArray, fileFormat:ImageFormat):Image { image = image == null ? new Image(0, 0) : image; image.copyImageFrom( switch fileFormat { @@ -165,22 +166,22 @@ class ImageTools { return image; } - public static function fromFile(?image:Image, path:String):Image { + public static overload extern inline function loadFromFile(?image:Image, path:String):Image { #if js return image.copyImageFrom(JsImageLoader.loadFileSync(path)); #else - return fromBytes(image, File.getBytes(path), Path.extension(path)); + return loadFromBytes(image, File.getBytes(path), Path.extension(path)); #end } - public static function fromURL(?image:Image, url:String):Image { + public static function loadFromURL(?image:Image, url:String):Image { #if js return image.copyImageFrom(JsImageLoader.loadURLSync(url)); #else var http = new Http(url); var requestStatus = 2; http.onBytes = (data) -> { - fromBytes(image, data, Path.extension(url)); + loadFromBytes(image, data, Path.extension(url)); requestStatus = 1; } http.onError = (msg) -> { @@ -208,7 +209,7 @@ class ImageTools { #end } - public static function toBytes(?image:Image, format:ImageFormat) { + public static function exportToBytes(?image:Image, format:ImageFormat) { image = image == null ? new Image(0, 0) : image; return switch format { case VISION: image.underlying; @@ -224,11 +225,11 @@ class ImageTools { }; } - public static function toFile(image:Image, pathWithFileName:String, format:ImageFormat = PNG) { + public static function exportToFile(image:Image, pathWithFileName:String, format:ImageFormat = PNG) { #if js JsImageExporter.saveToFileAsync(image, pathWithFileName, format); #else - File.saveBytes(pathWithFileName, toBytes(image, format)); + File.saveBytes(pathWithFileName, exportToBytes(image, format)); #end } From f96786461dcca311017181a5c6d1b10e93c724c4 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Wed, 28 May 2025 21:07:41 +0300 Subject: [PATCH 12/32] Starting the new generator --- tests/generator/compile.hxml | 6 ++++++ tests/generator/src/Main.hx | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/generator/compile.hxml create mode 100644 tests/generator/src/Main.hx diff --git a/tests/generator/compile.hxml b/tests/generator/compile.hxml new file mode 100644 index 00000000..33667b05 --- /dev/null +++ b/tests/generator/compile.hxml @@ -0,0 +1,6 @@ +--class-path src +--main Main + +--library vision + +--interp \ No newline at end of file diff --git a/tests/generator/src/Main.hx b/tests/generator/src/Main.hx new file mode 100644 index 00000000..2491ba4e --- /dev/null +++ b/tests/generator/src/Main.hx @@ -0,0 +1,7 @@ +package; + +class Main { + static function main() { + + } +} \ No newline at end of file From ee5ac929dff1c36cda3f006abbbdd686d5fd506a Mon Sep 17 00:00:00 2001 From: Shahar Marcus Date: Wed, 28 May 2025 22:28:50 +0300 Subject: [PATCH 13/32] First steps towards something simple --- tests/generator/src/Detector.hx | 54 +++++++++++++++++++ tests/generator/src/Generator.hx | 19 +++++++ tests/generator/src/Main.hx | 2 +- tests/generator/src/testing/TestResult.hx | 8 +++ .../templates/InstanceFunctionTestTemplate.hx | 12 +++++ .../templates/StaticFieldTestTemplate.hx | 11 ++++ .../templates/StaticFunctionTestTemplate.hx | 11 ++++ 7 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 tests/generator/src/Detector.hx create mode 100644 tests/generator/src/Generator.hx create mode 100644 tests/generator/src/testing/TestResult.hx create mode 100644 tests/generator/templates/InstanceFunctionTestTemplate.hx create mode 100644 tests/generator/templates/StaticFieldTestTemplate.hx create mode 100644 tests/generator/templates/StaticFunctionTestTemplate.hx diff --git a/tests/generator/src/Detector.hx b/tests/generator/src/Detector.hx new file mode 100644 index 00000000..06469c7b --- /dev/null +++ b/tests/generator/src/Detector.hx @@ -0,0 +1,54 @@ +package; + +import sys.io.File; +import sys.FileSystem; + +class Detector { + + static var packageFinder = ~/^package ([\w.]+)/m; + static var classNameFinder = ~/^class (\w+)/m; + static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; + static var staticFieldFinder = ~/(?:public static inline|public inline static|inline public static|public static) (?:var|final) (\w+)\(get, \w+\)/m; + + public static function detectOnFile(pathToHaxeFile:String) { + var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); + var fileContent = File.getContent(pathToHaxeFile), originalFileContent = fileContent; + + packageFinder.match(fileContent); + var packageName = packageFinder.matched(1); + fileContent = packageFinder.matchedRight(); + + classNameFinder.match(fileContent); + var className = classNameFinder.matched(1); + fileContent = classNameFinder.matchedRight(); + + originalFileContent = fileContent; + + var staticFunctions = new Map(); + while (staticFunctionFinder.match(fileContent)) { + var functionName = staticFunctionFinder.matched(1); + var functionParameters = staticFunctionFinder.matched(2); + fileContent = staticFunctionFinder.matchedRight(); + + staticFunctions.set(functionName, functionParameters); + } + + fileContent = originalFileContent; + + var staticFields = []; + while (staticFieldFinder.match(fileContent)) { + var fieldName = staticFieldFinder.matched(1); + fileContent = staticFieldFinder.matchedRight(); + + staticFields.push(fieldName); + } + + + return { + packageName: packageName, + className: className, + staticFunctions: staticFunctions, + staticFields: staticFields + } + } +} \ No newline at end of file diff --git a/tests/generator/src/Generator.hx b/tests/generator/src/Generator.hx new file mode 100644 index 00000000..6d665177 --- /dev/null +++ b/tests/generator/src/Generator.hx @@ -0,0 +1,19 @@ +package; + +import sys.FileSystem; +import sys.io.File; + + + +class Generator { + + public static var instanceFunctionTemplate = File.getContent("templates/InstanceFunctionTestTemplate.hx"); + public static var staticFunctionTemplate = File.getContent("templates/StaticFunctionTestTemplate.hx"); + public static var staticFieldTemplate = File.getContent("templates/StaticFieldTestTemplate.hx"); + + + public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String) { + var detections = Detector.detectOnFile(pathToHaxeFile); + trace(detections); + } +} \ No newline at end of file diff --git a/tests/generator/src/Main.hx b/tests/generator/src/Main.hx index 2491ba4e..da636c4a 100644 --- a/tests/generator/src/Main.hx +++ b/tests/generator/src/Main.hx @@ -2,6 +2,6 @@ package; class Main { static function main() { - + Generator.generateFromFile("../../src/vision/tools/MathTools.hx", "../tests/MathTools.test.hx"); } } \ No newline at end of file diff --git a/tests/generator/src/testing/TestResult.hx b/tests/generator/src/testing/TestResult.hx new file mode 100644 index 00000000..777e4668 --- /dev/null +++ b/tests/generator/src/testing/TestResult.hx @@ -0,0 +1,8 @@ +package testing; + +typedef TestResult = { + testName:String, + result: Dynamic, + expected: Dynamic, + success:Bool +} \ No newline at end of file diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx new file mode 100644 index 00000000..e76eae1a --- /dev/null +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -0,0 +1,12 @@ +public static function X1__X2__X3():TestResult { + + var object = new X4(); + var result = object.X5(X6); + + return { + testName: "X4#X5", + result: result, + expected: null, + success: null + } +} \ No newline at end of file diff --git a/tests/generator/templates/StaticFieldTestTemplate.hx b/tests/generator/templates/StaticFieldTestTemplate.hx new file mode 100644 index 00000000..81ae8192 --- /dev/null +++ b/tests/generator/templates/StaticFieldTestTemplate.hx @@ -0,0 +1,11 @@ +public static function X1__X2__X3():TestResult { + + var result = X4.X5; + + return { + testName: "X4.X5", + result: result, + expected: null, + success: null + } +} \ No newline at end of file diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx new file mode 100644 index 00000000..0a8ac57e --- /dev/null +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -0,0 +1,11 @@ +public static function X1__X2__X3():TestResult { + + var result = X4.X5(X6); + + return { + testName: "X4.X5", + result: result, + expected: null, + success: null + } +} \ No newline at end of file From 20fcf57574750bc0aece22aa1bb5a2e5ef06e2e3 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Thu, 29 May 2025 17:14:24 +0300 Subject: [PATCH 14/32] Detector now basically fully works, onto generation --- tests/generator/src/Detector.hx | 30 ++++++++++++++++++++++++++++-- tests/generator/src/Main.hx | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/generator/src/Detector.hx b/tests/generator/src/Detector.hx index 06469c7b..070e8cc5 100644 --- a/tests/generator/src/Detector.hx +++ b/tests/generator/src/Detector.hx @@ -6,9 +6,12 @@ import sys.FileSystem; class Detector { static var packageFinder = ~/^package ([\w.]+)/m; - static var classNameFinder = ~/^class (\w+)/m; + static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; static var staticFieldFinder = ~/(?:public static inline|public inline static|inline public static|public static) (?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFieldFinder = ~/(?:public inline|inline public|public) (?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; + public static function detectOnFile(pathToHaxeFile:String) { var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); @@ -43,12 +46,35 @@ class Detector { staticFields.push(fieldName); } + fileContent = originalFileContent; + + var instanceFunctions = new Map(); + + while (instanceFunctionFinder.match(fileContent)) { + var functionName = instanceFunctionFinder.matched(1); + var functionParameters = instanceFunctionFinder.matched(2); + fileContent = instanceFunctionFinder.matchedRight(); + + instanceFunctions.set(functionName, functionParameters); + } + + fileContent = originalFileContent; + + var instanceFields = []; + while (instanceFieldFinder.match(fileContent)) { + var fieldName = instanceFieldFinder.matched(1); + fileContent = instanceFieldFinder.matchedRight(); + + instanceFields.push(fieldName); + } return { packageName: packageName, className: className, staticFunctions: staticFunctions, - staticFields: staticFields + staticFields: staticFields, + instanceFunctions: instanceFunctions, + instanceFields: instanceFields } } } \ No newline at end of file diff --git a/tests/generator/src/Main.hx b/tests/generator/src/Main.hx index da636c4a..ab895f20 100644 --- a/tests/generator/src/Main.hx +++ b/tests/generator/src/Main.hx @@ -3,5 +3,6 @@ package; class Main { static function main() { Generator.generateFromFile("../../src/vision/tools/MathTools.hx", "../tests/MathTools.test.hx"); + Generator.generateFromFile("../../src/vision/ds/IntPoint2D.hx", "../tests/IntPoint2D.test.hx"); } } \ No newline at end of file From 141fd35bbd7ca589520ffa12a5dcd8f7a7a61932 Mon Sep 17 00:00:00 2001 From: ShaharMS Date: Thu, 29 May 2025 17:28:43 +0300 Subject: [PATCH 15/32] progress on generation --- tests/generator/src/Generator.hx | 25 +++++++++++++++++++ .../templates/InstanceFieldTestTemplate.hx | 12 +++++++++ .../templates/InstanceFunctionTestTemplate.hx | 4 +-- .../templates/StaticFieldTestTemplate.hx | 4 +-- .../templates/StaticFunctionTestTemplate.hx | 4 +-- tests/generator/templates/doc.hx | 10 ++++++++ 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 tests/generator/templates/InstanceFieldTestTemplate.hx create mode 100644 tests/generator/templates/doc.hx diff --git a/tests/generator/src/Generator.hx b/tests/generator/src/Generator.hx index 6d665177..7919b8df 100644 --- a/tests/generator/src/Generator.hx +++ b/tests/generator/src/Generator.hx @@ -7,13 +7,38 @@ import sys.io.File; class Generator { + public static var instanceFunctionTemplate = File.getContent("templates/InstanceFunctionTestTemplate.hx"); + public static var instanceFieldTemplate = File.getContent("templates/InstanceFieldTestTemplate.hx"); + public static var staticFunctionTemplate = File.getContent("templates/StaticFunctionTestTemplate.hx"); public static var staticFieldTemplate = File.getContent("templates/StaticFieldTestTemplate.hx"); public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String) { var detections = Detector.detectOnFile(pathToHaxeFile); + + trace(detections); } + + static function generateFileHeader(packageName:String, className:String) { + return 'package ${packageName};\n\nclass ${className} {\n'; + } + + static function generateFileFooter() { + return '\n}'; + } + + static function generateTest(template:String, testBase:TestBase) { + + } +} + +typedef TestBase = { + packageName:String, + className:String, + fieldName:String, + testGoal:String, + ?parameters:String } \ No newline at end of file diff --git a/tests/generator/templates/InstanceFieldTestTemplate.hx b/tests/generator/templates/InstanceFieldTestTemplate.hx new file mode 100644 index 00000000..1c56b268 --- /dev/null +++ b/tests/generator/templates/InstanceFieldTestTemplate.hx @@ -0,0 +1,12 @@ +public static function X1__X2__X3():TestResult { + + var object = new X4(); + var result = object.X2; + + return { + testName: "X4#X2", + result: result, + expected: null, + success: null + } +} \ No newline at end of file diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx index e76eae1a..b179df35 100644 --- a/tests/generator/templates/InstanceFunctionTestTemplate.hx +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -1,10 +1,10 @@ public static function X1__X2__X3():TestResult { var object = new X4(); - var result = object.X5(X6); + var result = object.X2(X6); return { - testName: "X4#X5", + testName: "X4#X2", result: result, expected: null, success: null diff --git a/tests/generator/templates/StaticFieldTestTemplate.hx b/tests/generator/templates/StaticFieldTestTemplate.hx index 81ae8192..1baf4069 100644 --- a/tests/generator/templates/StaticFieldTestTemplate.hx +++ b/tests/generator/templates/StaticFieldTestTemplate.hx @@ -1,9 +1,9 @@ public static function X1__X2__X3():TestResult { - var result = X4.X5; + var result = X4.X2; return { - testName: "X4.X5", + testName: "X4.X2", result: result, expected: null, success: null diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx index 0a8ac57e..759045d2 100644 --- a/tests/generator/templates/StaticFunctionTestTemplate.hx +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -1,9 +1,9 @@ public static function X1__X2__X3():TestResult { - var result = X4.X5(X6); + var result = X4.X2(X5); return { - testName: "X4.X5", + testName: "X4.X2", result: result, expected: null, success: null diff --git a/tests/generator/templates/doc.hx b/tests/generator/templates/doc.hx new file mode 100644 index 00000000..83949824 --- /dev/null +++ b/tests/generator/templates/doc.hx @@ -0,0 +1,10 @@ +package templates; + +/** + `X1` - package name + class name, with underscores instead of `.` + `X2` - field name to test + `X3` - test goal. Usually starts with "ShouldBe" or "ShouldEqual". + `X4` - class name, including full package, for example: `my.example.ClassInstance` + `X5` - optional - parameter list for when we test a function +**/ +public var doc:String; From 8984befed2f1d0be7ff3cb17acb3261f60bec672 Mon Sep 17 00:00:00 2001 From: Shahar Marcus Date: Fri, 30 May 2025 00:32:37 +0300 Subject: [PATCH 16/32] Major progress on generator --- tests/generated/IntPoint2D.test.hx | 114 ++ tests/generated/MathTools.test.hx | 1117 +++++++++++++++++ tests/generator/src/Detector.hx | 11 +- tests/generator/src/Generator.hx | 91 +- tests/generator/src/Main.hx | 4 +- .../templates/InstanceFieldTestTemplate.hx | 24 +- .../templates/InstanceFunctionTestTemplate.hx | 24 +- .../templates/StaticFieldTestTemplate.hx | 20 +- .../templates/StaticFunctionTestTemplate.hx | 22 +- .../generator/templates/TestClassActuator.hx | 19 + 10 files changed, 1395 insertions(+), 51 deletions(-) create mode 100644 tests/generated/IntPoint2D.test.hx create mode 100644 tests/generated/MathTools.test.hx create mode 100644 tests/generator/templates/TestClassActuator.hx diff --git a/tests/generated/IntPoint2D.test.hx b/tests/generated/IntPoint2D.test.hx new file mode 100644 index 00000000..6cfc2bb6 --- /dev/null +++ b/tests/generated/IntPoint2D.test.hx @@ -0,0 +1,114 @@ +package; + +import vision.exceptions.Unimplemented; + +class IntPoint2D { + public function vision_ds_IntPoint2D__x__ShouldWork():TestResult { + + var object = new vision.ds.IntPoint2D(); + var result = object.x; + + throw new Unimplemented("vision_ds_IntPoint2D__x__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D#x", + result: result, + expected: null, + success: null + } + } + + public function vision_ds_IntPoint2D__y__ShouldWork():TestResult { + + var object = new vision.ds.IntPoint2D(); + var result = object.y; + + throw new Unimplemented("vision_ds_IntPoint2D__y__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D#y", + result: result, + expected: null, + success: null + } + } + + public function vision_ds_IntPoint2D__fromPoint2D__ShouldWork():TestResult { + + var result = vision.ds.IntPoint2D.fromPoint2D(null); + + throw new Unimplemented("vision_ds_IntPoint2D__fromPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D.fromPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { + + var object = new vision.ds.IntPoint2D(); + var result = object.radiansTo(X6); + + throw new Unimplemented("vision_ds_IntPoint2D__radiansTo__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D#radiansTo", + result: result, + expected: null, + success: null + } + } + + public function vision_ds_IntPoint2D__distanceTo__ShouldWork():TestResult { + + var object = new vision.ds.IntPoint2D(); + var result = object.distanceTo(X6); + + throw new Unimplemented("vision_ds_IntPoint2D__distanceTo__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D#distanceTo", + result: result, + expected: null, + success: null + } + } + + public function vision_ds_IntPoint2D__degreesTo__ShouldWork():TestResult { + + var object = new vision.ds.IntPoint2D(); + var result = object.degreesTo(X6); + + throw new Unimplemented("vision_ds_IntPoint2D__degreesTo__ShouldWork Not Implemented"); + + return { + testName: "vision.ds.IntPoint2D#degreesTo", + result: result, + expected: null, + success: null + } + } + + public function new() { + var succeed = []; + var failed = []; + var skipped = []; + for (test in [{testFunction: vision_ds_IntPoint2D__fromPoint2D__ShouldWork, testName: "vision_ds_IntPoint2D__fromPoint2D__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__radiansTo__ShouldWork, testName: "vision_ds_IntPoint2D__radiansTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__distanceTo__ShouldWork, testName: "vision_ds_IntPoint2D__distanceTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__degreesTo__ShouldWork, testName: "vision_ds_IntPoint2D__degreesTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__x__ShouldWork, testName: "vision_ds_IntPoint2D__x__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__y__ShouldWork, testName: "vision_ds_IntPoint2D__y__ShouldWork"}]) { + try { + test.testFunction(); + } + catch (exception:Unimplemented) { + skipped.push(test.testName); + continue; + } + catch (exception:Exception) { + failed.push(test.testName); + continue; + } + succeed.push(test.testName); + } + } +} \ No newline at end of file diff --git a/tests/generated/MathTools.test.hx b/tests/generated/MathTools.test.hx new file mode 100644 index 00000000..e8218841 --- /dev/null +++ b/tests/generated/MathTools.test.hx @@ -0,0 +1,1117 @@ +package; + +import vision.exceptions.Unimplemented; + +class MathTools { + public function vision_tools_MathTools__PI__ShouldWork():TestResult { + + var result = vision.tools.MathTools.PI; + + throw new Unimplemented("vision_tools_MathTools__PI__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.PI", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__PI_OVER_2__ShouldWork():TestResult { + + var result = vision.tools.MathTools.PI_OVER_2; + + throw new Unimplemented("vision_tools_MathTools__PI_OVER_2__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.PI_OVER_2", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork():TestResult { + + var result = vision.tools.MathTools.NEGATIVE_INFINITY; + + throw new Unimplemented("vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.NEGATIVE_INFINITY", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork():TestResult { + + var result = vision.tools.MathTools.POSITIVE_INFINITY; + + throw new Unimplemented("vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.POSITIVE_INFINITY", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__NaN__ShouldWork():TestResult { + + var result = vision.tools.MathTools.NaN; + + throw new Unimplemented("vision_tools_MathTools__NaN__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.NaN", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__SQRT2__ShouldWork():TestResult { + + var result = vision.tools.MathTools.SQRT2; + + throw new Unimplemented("vision_tools_MathTools__SQRT2__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.SQRT2", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__SQRT3__ShouldWork():TestResult { + + var result = vision.tools.MathTools.SQRT3; + + throw new Unimplemented("vision_tools_MathTools__SQRT3__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.SQRT3", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__wrapInt__ShouldWork():TestResult { + + var result = vision.tools.MathTools.wrapInt(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__wrapInt__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.wrapInt", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__wrapFloat__ShouldWork():TestResult { + + var result = vision.tools.MathTools.wrapFloat(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__wrapFloat__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.wrapFloat", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__truncate__ShouldWork():TestResult { + + var result = vision.tools.MathTools.truncate(null,null); + + throw new Unimplemented("vision_tools_MathTools__truncate__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.truncate", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__toFloat__ShouldWork():TestResult { + + var result = vision.tools.MathTools.toFloat(null); + + throw new Unimplemented("vision_tools_MathTools__toFloat__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.toFloat", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__tand__ShouldWork():TestResult { + + var result = vision.tools.MathTools.tand(null); + + throw new Unimplemented("vision_tools_MathTools__tand__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.tand", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__tan__ShouldWork():TestResult { + + var result = vision.tools.MathTools.tan(null); + + throw new Unimplemented("vision_tools_MathTools__tan__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.tan", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__sqrt__ShouldWork():TestResult { + + var result = vision.tools.MathTools.sqrt(null); + + throw new Unimplemented("vision_tools_MathTools__sqrt__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.sqrt", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__slopeToRadians__ShouldWork():TestResult { + + var result = vision.tools.MathTools.slopeToRadians(null); + + throw new Unimplemented("vision_tools_MathTools__slopeToRadians__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.slopeToRadians", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__slopeToDegrees__ShouldWork():TestResult { + + var result = vision.tools.MathTools.slopeToDegrees(null); + + throw new Unimplemented("vision_tools_MathTools__slopeToDegrees__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.slopeToDegrees", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.slopeFromPointToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__sind__ShouldWork():TestResult { + + var result = vision.tools.MathTools.sind(null); + + throw new Unimplemented("vision_tools_MathTools__sind__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.sind", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__sin__ShouldWork():TestResult { + + var result = vision.tools.MathTools.sin(null); + + throw new Unimplemented("vision_tools_MathTools__sin__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.sin", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__secd__ShouldWork():TestResult { + + var result = vision.tools.MathTools.secd(null); + + throw new Unimplemented("vision_tools_MathTools__secd__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.secd", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__sec__ShouldWork():TestResult { + + var result = vision.tools.MathTools.sec(null); + + throw new Unimplemented("vision_tools_MathTools__sec__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.sec", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__round__ShouldWork():TestResult { + + var result = vision.tools.MathTools.round(null); + + throw new Unimplemented("vision_tools_MathTools__round__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.round", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { + + var result = vision.tools.MathTools.radiansToSlope(null); + + throw new Unimplemented("vision_tools_MathTools__radiansToSlope__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.radiansToSlope", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__radiansToDegrees__ShouldWork():TestResult { + + var result = vision.tools.MathTools.radiansToDegrees(null); + + throw new Unimplemented("vision_tools_MathTools__radiansToDegrees__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.radiansToDegrees", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.radiansFromPointToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.radiansFromPointToLine2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.radiansFromLineToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.radiansFromLineToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__pow__ShouldWork():TestResult { + + var result = vision.tools.MathTools.pow(null,null); + + throw new Unimplemented("vision_tools_MathTools__pow__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.pow", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__parseInt__ShouldWork():TestResult { + + var result = vision.tools.MathTools.parseInt(null); + + throw new Unimplemented("vision_tools_MathTools__parseInt__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.parseInt", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__parseFloat__ShouldWork():TestResult { + + var result = vision.tools.MathTools.parseFloat(null); + + throw new Unimplemented("vision_tools_MathTools__parseFloat__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.parseFloat", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__parseBool__ShouldWork():TestResult { + + var result = vision.tools.MathTools.parseBool(null); + + throw new Unimplemented("vision_tools_MathTools__parseBool__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.parseBool", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__mirrorInsideRectangle__ShouldWork():TestResult { + + var result = vision.tools.MathTools.mirrorInsideRectangle(null,null); + + throw new Unimplemented("vision_tools_MathTools__mirrorInsideRectangle__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.mirrorInsideRectangle", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__log__ShouldWork():TestResult { + + var result = vision.tools.MathTools.log(null); + + throw new Unimplemented("vision_tools_MathTools__log__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.log", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__isNaN__ShouldWork():TestResult { + + var result = vision.tools.MathTools.isNaN(null); + + throw new Unimplemented("vision_tools_MathTools__isNaN__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.isNaN", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__isInt__ShouldWork():TestResult { + + var result = vision.tools.MathTools.isInt(null); + + throw new Unimplemented("vision_tools_MathTools__isInt__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.isInt", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__isFinite__ShouldWork():TestResult { + + var result = vision.tools.MathTools.isFinite(null); + + throw new Unimplemented("vision_tools_MathTools__isFinite__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.isFinite", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__isBetweenRanges__ShouldWork():TestResult { + + var result = vision.tools.MathTools.isBetweenRanges(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__isBetweenRanges__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.isBetweenRanges", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__isBetweenRange__ShouldWork():TestResult { + + var result = vision.tools.MathTools.isBetweenRange(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__isBetweenRange__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.isBetweenRange", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__invertInsideRectangle__ShouldWork():TestResult { + + var result = vision.tools.MathTools.invertInsideRectangle(null,null); + + throw new Unimplemented("vision_tools_MathTools__invertInsideRectangle__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.invertInsideRectangle", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork():TestResult { + + var result = vision.tools.MathTools.intersectionBetweenRay2Ds(null,null); + + throw new Unimplemented("vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork():TestResult { + + var result = vision.tools.MathTools.intersectionBetweenLine2Ds(null,null); + + throw new Unimplemented("vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.getClosestPointOnRay2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__gamma__ShouldWork():TestResult { + + var result = vision.tools.MathTools.gamma(null); + + throw new Unimplemented("vision_tools_MathTools__gamma__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.gamma", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__fround__ShouldWork():TestResult { + + var result = vision.tools.MathTools.fround(null); + + throw new Unimplemented("vision_tools_MathTools__fround__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.fround", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__floor__ShouldWork():TestResult { + + var result = vision.tools.MathTools.floor(null); + + throw new Unimplemented("vision_tools_MathTools__floor__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.floor", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__flipInsideRectangle__ShouldWork():TestResult { + + var result = vision.tools.MathTools.flipInsideRectangle(null,null); + + throw new Unimplemented("vision_tools_MathTools__flipInsideRectangle__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.flipInsideRectangle", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork():TestResult { + + var result = vision.tools.MathTools.findPointAtDistanceUsingY(null,null,null,null); + + throw new Unimplemented("vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingY", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork():TestResult { + + var result = vision.tools.MathTools.findPointAtDistanceUsingX(null,null,null,null); + + throw new Unimplemented("vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingX", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__ffloor__ShouldWork():TestResult { + + var result = vision.tools.MathTools.ffloor(null); + + throw new Unimplemented("vision_tools_MathTools__ffloor__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.ffloor", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__fceil__ShouldWork():TestResult { + + var result = vision.tools.MathTools.fceil(null); + + throw new Unimplemented("vision_tools_MathTools__fceil__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.fceil", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__factorial__ShouldWork():TestResult { + + var result = vision.tools.MathTools.factorial(null); + + throw new Unimplemented("vision_tools_MathTools__factorial__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.factorial", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__exp__ShouldWork():TestResult { + + var result = vision.tools.MathTools.exp(null); + + throw new Unimplemented("vision_tools_MathTools__exp__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.exp", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceFromRayToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceFromRayToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceFromPointToRay2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceFromPointToLine2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceFromLineToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceBetweenRays2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceBetweenRays2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceBetweenRays2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceBetweenRays2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceBetweenPoints__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceBetweenPoints(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceBetweenPoints__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__distanceBetweenLines2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.distanceBetweenLines2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__distanceBetweenLines2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.distanceBetweenLines2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__degreesToSlope__ShouldWork():TestResult { + + var result = vision.tools.MathTools.degreesToSlope(null); + + throw new Unimplemented("vision_tools_MathTools__degreesToSlope__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.degreesToSlope", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__degreesToRadians__ShouldWork():TestResult { + + var result = vision.tools.MathTools.degreesToRadians(null); + + throw new Unimplemented("vision_tools_MathTools__degreesToRadians__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.degreesToRadians", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork():TestResult { + + var result = vision.tools.MathTools.degreesFromPointToPoint2D(null,null); + + throw new Unimplemented("vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cropDecimal__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cropDecimal(null); + + throw new Unimplemented("vision_tools_MathTools__cropDecimal__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cropDecimal", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cotand__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cotand(null); + + throw new Unimplemented("vision_tools_MathTools__cotand__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cotand", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cotan__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cotan(null); + + throw new Unimplemented("vision_tools_MathTools__cotan__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cotan", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cosecd__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cosecd(null); + + throw new Unimplemented("vision_tools_MathTools__cosecd__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cosecd", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cosec__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cosec(null); + + throw new Unimplemented("vision_tools_MathTools__cosec__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cosec", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cosd__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cosd(null); + + throw new Unimplemented("vision_tools_MathTools__cosd__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cosd", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__cos__ShouldWork():TestResult { + + var result = vision.tools.MathTools.cos(null); + + throw new Unimplemented("vision_tools_MathTools__cos__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.cos", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__clamp__ShouldWork():TestResult { + + var result = vision.tools.MathTools.clamp(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__clamp__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.clamp", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__ceil__ShouldWork():TestResult { + + var result = vision.tools.MathTools.ceil(null); + + throw new Unimplemented("vision_tools_MathTools__ceil__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.ceil", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__boundInt__ShouldWork():TestResult { + + var result = vision.tools.MathTools.boundInt(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__boundInt__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.boundInt", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__boundFloat__ShouldWork():TestResult { + + var result = vision.tools.MathTools.boundFloat(null,null,null); + + throw new Unimplemented("vision_tools_MathTools__boundFloat__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.boundFloat", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__atan2__ShouldWork():TestResult { + + var result = vision.tools.MathTools.atan2(null,null); + + throw new Unimplemented("vision_tools_MathTools__atan2__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.atan2", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__atan__ShouldWork():TestResult { + + var result = vision.tools.MathTools.atan(null); + + throw new Unimplemented("vision_tools_MathTools__atan__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.atan", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__asin__ShouldWork():TestResult { + + var result = vision.tools.MathTools.asin(null); + + throw new Unimplemented("vision_tools_MathTools__asin__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.asin", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__acos__ShouldWork():TestResult { + + var result = vision.tools.MathTools.acos(null); + + throw new Unimplemented("vision_tools_MathTools__acos__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.acos", + result: result, + expected: null, + success: null + } + } + + public function vision_tools_MathTools__abs__ShouldWork():TestResult { + + var result = vision.tools.MathTools.abs(null); + + throw new Unimplemented("vision_tools_MathTools__abs__ShouldWork Not Implemented"); + + return { + testName: "vision.tools.MathTools.abs", + result: result, + expected: null, + success: null + } + } + + public function new() { + var succeed = []; + var failed = []; + var skipped = []; + for (test in [{testFunction: vision_tools_MathTools__wrapInt__ShouldWork, testName: "vision_tools_MathTools__wrapInt__ShouldWork"}, {testFunction: vision_tools_MathTools__wrapFloat__ShouldWork, testName: "vision_tools_MathTools__wrapFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__truncate__ShouldWork, testName: "vision_tools_MathTools__truncate__ShouldWork"}, {testFunction: vision_tools_MathTools__toFloat__ShouldWork, testName: "vision_tools_MathTools__toFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__tand__ShouldWork, testName: "vision_tools_MathTools__tand__ShouldWork"}, {testFunction: vision_tools_MathTools__tan__ShouldWork, testName: "vision_tools_MathTools__tan__ShouldWork"}, {testFunction: vision_tools_MathTools__sqrt__ShouldWork, testName: "vision_tools_MathTools__sqrt__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeToRadians__ShouldWork, testName: "vision_tools_MathTools__slopeToRadians__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeToDegrees__ShouldWork, testName: "vision_tools_MathTools__slopeToDegrees__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__sind__ShouldWork, testName: "vision_tools_MathTools__sind__ShouldWork"}, {testFunction: vision_tools_MathTools__sin__ShouldWork, testName: "vision_tools_MathTools__sin__ShouldWork"}, {testFunction: vision_tools_MathTools__secd__ShouldWork, testName: "vision_tools_MathTools__secd__ShouldWork"}, {testFunction: vision_tools_MathTools__sec__ShouldWork, testName: "vision_tools_MathTools__sec__ShouldWork"}, {testFunction: vision_tools_MathTools__round__ShouldWork, testName: "vision_tools_MathTools__round__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansToSlope__ShouldWork, testName: "vision_tools_MathTools__radiansToSlope__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansToDegrees__ShouldWork, testName: "vision_tools_MathTools__radiansToDegrees__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__pow__ShouldWork, testName: "vision_tools_MathTools__pow__ShouldWork"}, {testFunction: vision_tools_MathTools__parseInt__ShouldWork, testName: "vision_tools_MathTools__parseInt__ShouldWork"}, {testFunction: vision_tools_MathTools__parseFloat__ShouldWork, testName: "vision_tools_MathTools__parseFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__parseBool__ShouldWork, testName: "vision_tools_MathTools__parseBool__ShouldWork"}, {testFunction: vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__mirrorInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__log__ShouldWork, testName: "vision_tools_MathTools__log__ShouldWork"}, {testFunction: vision_tools_MathTools__isNaN__ShouldWork, testName: "vision_tools_MathTools__isNaN__ShouldWork"}, {testFunction: vision_tools_MathTools__isInt__ShouldWork, testName: "vision_tools_MathTools__isInt__ShouldWork"}, {testFunction: vision_tools_MathTools__isFinite__ShouldWork, testName: "vision_tools_MathTools__isFinite__ShouldWork"}, {testFunction: vision_tools_MathTools__isBetweenRanges__ShouldWork, testName: "vision_tools_MathTools__isBetweenRanges__ShouldWork"}, {testFunction: vision_tools_MathTools__isBetweenRange__ShouldWork, testName: "vision_tools_MathTools__isBetweenRange__ShouldWork"}, {testFunction: vision_tools_MathTools__invertInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__invertInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork"}, {testFunction: vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork"}, {testFunction: vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, testName: "vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork"}, {testFunction: vision_tools_MathTools__gamma__ShouldWork, testName: "vision_tools_MathTools__gamma__ShouldWork"}, {testFunction: vision_tools_MathTools__fround__ShouldWork, testName: "vision_tools_MathTools__fround__ShouldWork"}, {testFunction: vision_tools_MathTools__floor__ShouldWork, testName: "vision_tools_MathTools__floor__ShouldWork"}, {testFunction: vision_tools_MathTools__flipInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__flipInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork"}, {testFunction: vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork"}, {testFunction: vision_tools_MathTools__ffloor__ShouldWork, testName: "vision_tools_MathTools__ffloor__ShouldWork"}, {testFunction: vision_tools_MathTools__fceil__ShouldWork, testName: "vision_tools_MathTools__fceil__ShouldWork"}, {testFunction: vision_tools_MathTools__factorial__ShouldWork, testName: "vision_tools_MathTools__factorial__ShouldWork"}, {testFunction: vision_tools_MathTools__exp__ShouldWork, testName: "vision_tools_MathTools__exp__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenRays2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenPoints__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenPoints__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenLines2D__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesToSlope__ShouldWork, testName: "vision_tools_MathTools__degreesToSlope__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesToRadians__ShouldWork, testName: "vision_tools_MathTools__degreesToRadians__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__cropDecimal__ShouldWork, testName: "vision_tools_MathTools__cropDecimal__ShouldWork"}, {testFunction: vision_tools_MathTools__cotand__ShouldWork, testName: "vision_tools_MathTools__cotand__ShouldWork"}, {testFunction: vision_tools_MathTools__cotan__ShouldWork, testName: "vision_tools_MathTools__cotan__ShouldWork"}, {testFunction: vision_tools_MathTools__cosecd__ShouldWork, testName: "vision_tools_MathTools__cosecd__ShouldWork"}, {testFunction: vision_tools_MathTools__cosec__ShouldWork, testName: "vision_tools_MathTools__cosec__ShouldWork"}, {testFunction: vision_tools_MathTools__cosd__ShouldWork, testName: "vision_tools_MathTools__cosd__ShouldWork"}, {testFunction: vision_tools_MathTools__cos__ShouldWork, testName: "vision_tools_MathTools__cos__ShouldWork"}, {testFunction: vision_tools_MathTools__clamp__ShouldWork, testName: "vision_tools_MathTools__clamp__ShouldWork"}, {testFunction: vision_tools_MathTools__ceil__ShouldWork, testName: "vision_tools_MathTools__ceil__ShouldWork"}, {testFunction: vision_tools_MathTools__boundInt__ShouldWork, testName: "vision_tools_MathTools__boundInt__ShouldWork"}, {testFunction: vision_tools_MathTools__boundFloat__ShouldWork, testName: "vision_tools_MathTools__boundFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__atan2__ShouldWork, testName: "vision_tools_MathTools__atan2__ShouldWork"}, {testFunction: vision_tools_MathTools__atan__ShouldWork, testName: "vision_tools_MathTools__atan__ShouldWork"}, {testFunction: vision_tools_MathTools__asin__ShouldWork, testName: "vision_tools_MathTools__asin__ShouldWork"}, {testFunction: vision_tools_MathTools__acos__ShouldWork, testName: "vision_tools_MathTools__acos__ShouldWork"}, {testFunction: vision_tools_MathTools__abs__ShouldWork, testName: "vision_tools_MathTools__abs__ShouldWork"}, {testFunction: vision_tools_MathTools__PI__ShouldWork, testName: "vision_tools_MathTools__PI__ShouldWork"}, {testFunction: vision_tools_MathTools__PI_OVER_2__ShouldWork, testName: "vision_tools_MathTools__PI_OVER_2__ShouldWork"}, {testFunction: vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork"}, {testFunction: vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork"}, {testFunction: vision_tools_MathTools__NaN__ShouldWork, testName: "vision_tools_MathTools__NaN__ShouldWork"}, {testFunction: vision_tools_MathTools__SQRT2__ShouldWork, testName: "vision_tools_MathTools__SQRT2__ShouldWork"}, {testFunction: vision_tools_MathTools__SQRT3__ShouldWork, testName: "vision_tools_MathTools__SQRT3__ShouldWork"}]) { + try { + test.testFunction(); + } + catch (exception:Unimplemented) { + skipped.push(test.testName); + continue; + } + catch (exception:Exception) { + failed.push(test.testName); + continue; + } + succeed.push(test.testName); + } + } +} \ No newline at end of file diff --git a/tests/generator/src/Detector.hx b/tests/generator/src/Detector.hx index 070e8cc5..406f9fb0 100644 --- a/tests/generator/src/Detector.hx +++ b/tests/generator/src/Detector.hx @@ -13,7 +13,7 @@ class Detector { static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; - public static function detectOnFile(pathToHaxeFile:String) { + public static function detectOnFile(pathToHaxeFile:String):TestDetections { var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); var fileContent = File.getContent(pathToHaxeFile), originalFileContent = fileContent; @@ -77,4 +77,13 @@ class Detector { instanceFields: instanceFields } } +} + +typedef TestDetections = { + packageName:String, + className:String, + staticFunctions:Map, + staticFields:Array, + instanceFunctions:Map, + instanceFields:Array } \ No newline at end of file diff --git a/tests/generator/src/Generator.hx b/tests/generator/src/Generator.hx index 7919b8df..8337fdc0 100644 --- a/tests/generator/src/Generator.hx +++ b/tests/generator/src/Generator.hx @@ -1,37 +1,114 @@ package; +import Detector.TestDetections; import sys.FileSystem; import sys.io.File; +using StringTools; class Generator { - public static var instanceFunctionTemplate = File.getContent("templates/InstanceFunctionTestTemplate.hx"); - public static var instanceFieldTemplate = File.getContent("templates/InstanceFieldTestTemplate.hx"); + public static var instanceFunctionTemplate = File.getContent(FileSystem.absolutePath("templates/InstanceFunctionTestTemplate.hx")); + public static var instanceFieldTemplate = File.getContent(FileSystem.absolutePath("templates/InstanceFieldTestTemplate.hx")); - public static var staticFunctionTemplate = File.getContent("templates/StaticFunctionTestTemplate.hx"); - public static var staticFieldTemplate = File.getContent("templates/StaticFieldTestTemplate.hx"); + public static var staticFunctionTemplate = File.getContent(FileSystem.absolutePath("templates/StaticFunctionTestTemplate.hx")); + public static var staticFieldTemplate = File.getContent(FileSystem.absolutePath("templates/StaticFieldTestTemplate.hx")); + public static var testClassActuatorTemplate = File.getContent(FileSystem.absolutePath("templates/TestClassActuator.hx")); public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String) { var detections = Detector.detectOnFile(pathToHaxeFile); + var file = File.write(FileSystem.absolutePath(pathToOutputFile)); + file.writeString(generateFileHeader(detections.packageName, detections.className)); - trace(detections); + for (field in detections.staticFields) { + file.writeString(generateTest(staticFieldTemplate, { + packageName: detections.packageName, + className: detections.className, + fieldName: field, + testGoal: "ShouldWork" + })); + } + + for (field in detections.instanceFields) { + file.writeString(generateTest(instanceFieldTemplate, { + packageName: detections.packageName, + className: detections.className, + fieldName: field, + testGoal: "ShouldWork" + })); + } + + for (method => parameters in detections.staticFunctions) { + var nulledOutParameters = parameters.split(",").map(x -> "null").join(","); + file.writeString(generateTest(staticFunctionTemplate, { + packageName: detections.packageName, + className: detections.className, + fieldName: method, + testGoal: "ShouldWork", + parameters: nulledOutParameters + })); + } + + for (method => parameters in detections.instanceFunctions) { + var nulledOutParameters = parameters.split(",").map(x -> "null").join(","); + file.writeString(generateTest(instanceFunctionTemplate, { + packageName: detections.packageName, + className: detections.className, + fieldName: method, + testGoal: "ShouldWork", + parameters: nulledOutParameters + })); + } + + file.writeString(generateConstructor(detections)); + + file.writeString(generateFileFooter()); + + file.close(); } static function generateFileHeader(packageName:String, className:String) { - return 'package ${packageName};\n\nclass ${className} {\n'; + return 'package;\n\nimport vision.exceptions.Unimplemented;\n\nclass ${className} {\n'; } static function generateFileFooter() { return '\n}'; } - static function generateTest(template:String, testBase:TestBase) { + static function generateTest(template:String, testBase:TestBase):String { + var cleanPackage = testBase.packageName.replace(".", "_") + '_${testBase.className}'; + testBase.parameters ??= ""; + return template + .replace("X1", cleanPackage) + .replace("X2", testBase.fieldName) + .replace("X3", testBase.testGoal) + .replace("X4", '${testBase.packageName}.${testBase.className}') + .replace("X5", testBase.parameters) + "\n\n"; + } + + static function generateConstructor(detections:TestDetections) { + var cleanPackage = detections.packageName.replace(".", "_") + '_${detections.className}'; + var functionNames = []; + for (method in detections.staticFunctions.keys()) { + functionNames.push('${cleanPackage}__${method}__ShouldWork'); + } + for (method in detections.instanceFunctions.keys()) { + functionNames.push('${cleanPackage}__${method}__ShouldWork'); + } + for (field in detections.staticFields) { + functionNames.push('${cleanPackage}__${field}__ShouldWork'); + } + for (field in detections.instanceFields) { + functionNames.push('${cleanPackage}__${field}__ShouldWork'); + } + + functionNames = functionNames.map(x -> '{testFunction: $x, testName: "$x"}'); + return testClassActuatorTemplate.replace("TEST_ARRAY", functionNames.join(", ")); } } diff --git a/tests/generator/src/Main.hx b/tests/generator/src/Main.hx index ab895f20..0be32bcf 100644 --- a/tests/generator/src/Main.hx +++ b/tests/generator/src/Main.hx @@ -2,7 +2,7 @@ package; class Main { static function main() { - Generator.generateFromFile("../../src/vision/tools/MathTools.hx", "../tests/MathTools.test.hx"); - Generator.generateFromFile("../../src/vision/ds/IntPoint2D.hx", "../tests/IntPoint2D.test.hx"); + Generator.generateFromFile("../../src/vision/tools/MathTools.hx", "../generated/MathTools.test.hx"); + Generator.generateFromFile("../../src/vision/ds/IntPoint2D.hx", "../generated/IntPoint2D.test.hx"); } } \ No newline at end of file diff --git a/tests/generator/templates/InstanceFieldTestTemplate.hx b/tests/generator/templates/InstanceFieldTestTemplate.hx index 1c56b268..05ae1b40 100644 --- a/tests/generator/templates/InstanceFieldTestTemplate.hx +++ b/tests/generator/templates/InstanceFieldTestTemplate.hx @@ -1,12 +1,14 @@ -public static function X1__X2__X3():TestResult { - - var object = new X4(); - var result = object.X2; + public function X1__X2__X3():TestResult { - return { - testName: "X4#X2", - result: result, - expected: null, - success: null - } -} \ No newline at end of file + var object = new X4(); + var result = object.X2; + + throw new Unimplemented("X1__X2__X3 Not Implemented"); + + return { + testName: "X4#X2", + result: result, + expected: null, + success: null + } + } \ No newline at end of file diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx index b179df35..c8bee0a6 100644 --- a/tests/generator/templates/InstanceFunctionTestTemplate.hx +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -1,12 +1,14 @@ -public static function X1__X2__X3():TestResult { - - var object = new X4(); - var result = object.X2(X6); + public function X1__X2__X3():TestResult { - return { - testName: "X4#X2", - result: result, - expected: null, - success: null - } -} \ No newline at end of file + var object = new X4(); + var result = object.X2(X6); + + throw new Unimplemented("X1__X2__X3 Not Implemented"); + + return { + testName: "X4#X2", + result: result, + expected: null, + success: null + } + } \ No newline at end of file diff --git a/tests/generator/templates/StaticFieldTestTemplate.hx b/tests/generator/templates/StaticFieldTestTemplate.hx index 1baf4069..27546f1c 100644 --- a/tests/generator/templates/StaticFieldTestTemplate.hx +++ b/tests/generator/templates/StaticFieldTestTemplate.hx @@ -1,11 +1,13 @@ -public static function X1__X2__X3():TestResult { + public function X1__X2__X3():TestResult { + + var result = X4.X2; - var result = X4.X2; + throw new Unimplemented("X1__X2__X3 Not Implemented"); - return { - testName: "X4.X2", - result: result, - expected: null, - success: null - } -} \ No newline at end of file + return { + testName: "X4.X2", + result: result, + expected: null, + success: null + } + } \ No newline at end of file diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx index 759045d2..42308293 100644 --- a/tests/generator/templates/StaticFunctionTestTemplate.hx +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -1,11 +1,13 @@ -public static function X1__X2__X3():TestResult { - - var result = X4.X2(X5); + public function X1__X2__X3():TestResult { - return { - testName: "X4.X2", - result: result, - expected: null, - success: null - } -} \ No newline at end of file + var result = X4.X2(X5); + + throw new Unimplemented("X1__X2__X3 Not Implemented"); + + return { + testName: "X4.X2", + result: result, + expected: null, + success: null + } + } \ No newline at end of file diff --git a/tests/generator/templates/TestClassActuator.hx b/tests/generator/templates/TestClassActuator.hx new file mode 100644 index 00000000..7a599c89 --- /dev/null +++ b/tests/generator/templates/TestClassActuator.hx @@ -0,0 +1,19 @@ + public function new() { + var succeed = []; + var failed = []; + var skipped = []; + for (test in [TEST_ARRAY]) { + try { + test.testFunction(); + } + catch (exception:Unimplemented) { + skipped.push(test.testName); + continue; + } + catch (exception:Exception) { + failed.push(test.testName); + continue; + } + succeed.push(test.testName); + } + } \ No newline at end of file From a3484624ed8655a826c497cfd585758bf7c73bb3 Mon Sep 17 00:00:00 2001 From: Shahar Marcus Date: Fri, 30 May 2025 00:42:23 +0300 Subject: [PATCH 17/32] generated test classes are pretty much done --- tests/generated/IntPoint2D.test.hx | 29 ++--- tests/generated/MathTools.test.hx | 101 ++++++++++++++---- tests/generated/TestResult.hx | 8 ++ tests/generator/src/Generator.hx | 4 +- .../generator/templates/TestClassActuator.hx | 22 +--- 5 files changed, 105 insertions(+), 59 deletions(-) create mode 100644 tests/generated/TestResult.hx diff --git a/tests/generated/IntPoint2D.test.hx b/tests/generated/IntPoint2D.test.hx index 6cfc2bb6..b281c3bb 100644 --- a/tests/generated/IntPoint2D.test.hx +++ b/tests/generated/IntPoint2D.test.hx @@ -1,6 +1,7 @@ package; import vision.exceptions.Unimplemented; +import TestResult; class IntPoint2D { public function vision_ds_IntPoint2D__x__ShouldWork():TestResult { @@ -92,23 +93,13 @@ class IntPoint2D { } } - public function new() { - var succeed = []; - var failed = []; - var skipped = []; - for (test in [{testFunction: vision_ds_IntPoint2D__fromPoint2D__ShouldWork, testName: "vision_ds_IntPoint2D__fromPoint2D__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__radiansTo__ShouldWork, testName: "vision_ds_IntPoint2D__radiansTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__distanceTo__ShouldWork, testName: "vision_ds_IntPoint2D__distanceTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__degreesTo__ShouldWork, testName: "vision_ds_IntPoint2D__degreesTo__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__x__ShouldWork, testName: "vision_ds_IntPoint2D__x__ShouldWork"}, {testFunction: vision_ds_IntPoint2D__y__ShouldWork, testName: "vision_ds_IntPoint2D__y__ShouldWork"}]) { - try { - test.testFunction(); - } - catch (exception:Unimplemented) { - skipped.push(test.testName); - continue; - } - catch (exception:Exception) { - failed.push(test.testName); - continue; - } - succeed.push(test.testName); - } - } + public var tests = [ + {testFunction: vision_ds_IntPoint2D__fromPoint2D__ShouldWork, testName: "vision_ds_IntPoint2D__fromPoint2D__ShouldWork"}, + {testFunction: vision_ds_IntPoint2D__radiansTo__ShouldWork, testName: "vision_ds_IntPoint2D__radiansTo__ShouldWork"}, + {testFunction: vision_ds_IntPoint2D__distanceTo__ShouldWork, testName: "vision_ds_IntPoint2D__distanceTo__ShouldWork"}, + {testFunction: vision_ds_IntPoint2D__degreesTo__ShouldWork, testName: "vision_ds_IntPoint2D__degreesTo__ShouldWork"}, + {testFunction: vision_ds_IntPoint2D__x__ShouldWork, testName: "vision_ds_IntPoint2D__x__ShouldWork"}, + {testFunction: vision_ds_IntPoint2D__y__ShouldWork, testName: "vision_ds_IntPoint2D__y__ShouldWork"}]; + + public function new() {} } \ No newline at end of file diff --git a/tests/generated/MathTools.test.hx b/tests/generated/MathTools.test.hx index e8218841..d6e14f19 100644 --- a/tests/generated/MathTools.test.hx +++ b/tests/generated/MathTools.test.hx @@ -1,6 +1,7 @@ package; import vision.exceptions.Unimplemented; +import TestResult; class MathTools { public function vision_tools_MathTools__PI__ShouldWork():TestResult { @@ -1095,23 +1096,85 @@ class MathTools { } } - public function new() { - var succeed = []; - var failed = []; - var skipped = []; - for (test in [{testFunction: vision_tools_MathTools__wrapInt__ShouldWork, testName: "vision_tools_MathTools__wrapInt__ShouldWork"}, {testFunction: vision_tools_MathTools__wrapFloat__ShouldWork, testName: "vision_tools_MathTools__wrapFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__truncate__ShouldWork, testName: "vision_tools_MathTools__truncate__ShouldWork"}, {testFunction: vision_tools_MathTools__toFloat__ShouldWork, testName: "vision_tools_MathTools__toFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__tand__ShouldWork, testName: "vision_tools_MathTools__tand__ShouldWork"}, {testFunction: vision_tools_MathTools__tan__ShouldWork, testName: "vision_tools_MathTools__tan__ShouldWork"}, {testFunction: vision_tools_MathTools__sqrt__ShouldWork, testName: "vision_tools_MathTools__sqrt__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeToRadians__ShouldWork, testName: "vision_tools_MathTools__slopeToRadians__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeToDegrees__ShouldWork, testName: "vision_tools_MathTools__slopeToDegrees__ShouldWork"}, {testFunction: vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__sind__ShouldWork, testName: "vision_tools_MathTools__sind__ShouldWork"}, {testFunction: vision_tools_MathTools__sin__ShouldWork, testName: "vision_tools_MathTools__sin__ShouldWork"}, {testFunction: vision_tools_MathTools__secd__ShouldWork, testName: "vision_tools_MathTools__secd__ShouldWork"}, {testFunction: vision_tools_MathTools__sec__ShouldWork, testName: "vision_tools_MathTools__sec__ShouldWork"}, {testFunction: vision_tools_MathTools__round__ShouldWork, testName: "vision_tools_MathTools__round__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansToSlope__ShouldWork, testName: "vision_tools_MathTools__radiansToSlope__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansToDegrees__ShouldWork, testName: "vision_tools_MathTools__radiansToDegrees__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork"}, {testFunction: vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__pow__ShouldWork, testName: "vision_tools_MathTools__pow__ShouldWork"}, {testFunction: vision_tools_MathTools__parseInt__ShouldWork, testName: "vision_tools_MathTools__parseInt__ShouldWork"}, {testFunction: vision_tools_MathTools__parseFloat__ShouldWork, testName: "vision_tools_MathTools__parseFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__parseBool__ShouldWork, testName: "vision_tools_MathTools__parseBool__ShouldWork"}, {testFunction: vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__mirrorInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__log__ShouldWork, testName: "vision_tools_MathTools__log__ShouldWork"}, {testFunction: vision_tools_MathTools__isNaN__ShouldWork, testName: "vision_tools_MathTools__isNaN__ShouldWork"}, {testFunction: vision_tools_MathTools__isInt__ShouldWork, testName: "vision_tools_MathTools__isInt__ShouldWork"}, {testFunction: vision_tools_MathTools__isFinite__ShouldWork, testName: "vision_tools_MathTools__isFinite__ShouldWork"}, {testFunction: vision_tools_MathTools__isBetweenRanges__ShouldWork, testName: "vision_tools_MathTools__isBetweenRanges__ShouldWork"}, {testFunction: vision_tools_MathTools__isBetweenRange__ShouldWork, testName: "vision_tools_MathTools__isBetweenRange__ShouldWork"}, {testFunction: vision_tools_MathTools__invertInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__invertInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork"}, {testFunction: vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork"}, {testFunction: vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, testName: "vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork"}, {testFunction: vision_tools_MathTools__gamma__ShouldWork, testName: "vision_tools_MathTools__gamma__ShouldWork"}, {testFunction: vision_tools_MathTools__fround__ShouldWork, testName: "vision_tools_MathTools__fround__ShouldWork"}, {testFunction: vision_tools_MathTools__floor__ShouldWork, testName: "vision_tools_MathTools__floor__ShouldWork"}, {testFunction: vision_tools_MathTools__flipInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__flipInsideRectangle__ShouldWork"}, {testFunction: vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork"}, {testFunction: vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork"}, {testFunction: vision_tools_MathTools__ffloor__ShouldWork, testName: "vision_tools_MathTools__ffloor__ShouldWork"}, {testFunction: vision_tools_MathTools__fceil__ShouldWork, testName: "vision_tools_MathTools__fceil__ShouldWork"}, {testFunction: vision_tools_MathTools__factorial__ShouldWork, testName: "vision_tools_MathTools__factorial__ShouldWork"}, {testFunction: vision_tools_MathTools__exp__ShouldWork, testName: "vision_tools_MathTools__exp__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenRays2D__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenPoints__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenPoints__ShouldWork"}, {testFunction: vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenLines2D__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesToSlope__ShouldWork, testName: "vision_tools_MathTools__degreesToSlope__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesToRadians__ShouldWork, testName: "vision_tools_MathTools__degreesToRadians__ShouldWork"}, {testFunction: vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork"}, {testFunction: vision_tools_MathTools__cropDecimal__ShouldWork, testName: "vision_tools_MathTools__cropDecimal__ShouldWork"}, {testFunction: vision_tools_MathTools__cotand__ShouldWork, testName: "vision_tools_MathTools__cotand__ShouldWork"}, {testFunction: vision_tools_MathTools__cotan__ShouldWork, testName: "vision_tools_MathTools__cotan__ShouldWork"}, {testFunction: vision_tools_MathTools__cosecd__ShouldWork, testName: "vision_tools_MathTools__cosecd__ShouldWork"}, {testFunction: vision_tools_MathTools__cosec__ShouldWork, testName: "vision_tools_MathTools__cosec__ShouldWork"}, {testFunction: vision_tools_MathTools__cosd__ShouldWork, testName: "vision_tools_MathTools__cosd__ShouldWork"}, {testFunction: vision_tools_MathTools__cos__ShouldWork, testName: "vision_tools_MathTools__cos__ShouldWork"}, {testFunction: vision_tools_MathTools__clamp__ShouldWork, testName: "vision_tools_MathTools__clamp__ShouldWork"}, {testFunction: vision_tools_MathTools__ceil__ShouldWork, testName: "vision_tools_MathTools__ceil__ShouldWork"}, {testFunction: vision_tools_MathTools__boundInt__ShouldWork, testName: "vision_tools_MathTools__boundInt__ShouldWork"}, {testFunction: vision_tools_MathTools__boundFloat__ShouldWork, testName: "vision_tools_MathTools__boundFloat__ShouldWork"}, {testFunction: vision_tools_MathTools__atan2__ShouldWork, testName: "vision_tools_MathTools__atan2__ShouldWork"}, {testFunction: vision_tools_MathTools__atan__ShouldWork, testName: "vision_tools_MathTools__atan__ShouldWork"}, {testFunction: vision_tools_MathTools__asin__ShouldWork, testName: "vision_tools_MathTools__asin__ShouldWork"}, {testFunction: vision_tools_MathTools__acos__ShouldWork, testName: "vision_tools_MathTools__acos__ShouldWork"}, {testFunction: vision_tools_MathTools__abs__ShouldWork, testName: "vision_tools_MathTools__abs__ShouldWork"}, {testFunction: vision_tools_MathTools__PI__ShouldWork, testName: "vision_tools_MathTools__PI__ShouldWork"}, {testFunction: vision_tools_MathTools__PI_OVER_2__ShouldWork, testName: "vision_tools_MathTools__PI_OVER_2__ShouldWork"}, {testFunction: vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork"}, {testFunction: vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork"}, {testFunction: vision_tools_MathTools__NaN__ShouldWork, testName: "vision_tools_MathTools__NaN__ShouldWork"}, {testFunction: vision_tools_MathTools__SQRT2__ShouldWork, testName: "vision_tools_MathTools__SQRT2__ShouldWork"}, {testFunction: vision_tools_MathTools__SQRT3__ShouldWork, testName: "vision_tools_MathTools__SQRT3__ShouldWork"}]) { - try { - test.testFunction(); - } - catch (exception:Unimplemented) { - skipped.push(test.testName); - continue; - } - catch (exception:Exception) { - failed.push(test.testName); - continue; - } - succeed.push(test.testName); - } - } + public var tests = [ + {testFunction: vision_tools_MathTools__wrapInt__ShouldWork, testName: "vision_tools_MathTools__wrapInt__ShouldWork"}, + {testFunction: vision_tools_MathTools__wrapFloat__ShouldWork, testName: "vision_tools_MathTools__wrapFloat__ShouldWork"}, + {testFunction: vision_tools_MathTools__truncate__ShouldWork, testName: "vision_tools_MathTools__truncate__ShouldWork"}, + {testFunction: vision_tools_MathTools__toFloat__ShouldWork, testName: "vision_tools_MathTools__toFloat__ShouldWork"}, + {testFunction: vision_tools_MathTools__tand__ShouldWork, testName: "vision_tools_MathTools__tand__ShouldWork"}, + {testFunction: vision_tools_MathTools__tan__ShouldWork, testName: "vision_tools_MathTools__tan__ShouldWork"}, + {testFunction: vision_tools_MathTools__sqrt__ShouldWork, testName: "vision_tools_MathTools__sqrt__ShouldWork"}, + {testFunction: vision_tools_MathTools__slopeToRadians__ShouldWork, testName: "vision_tools_MathTools__slopeToRadians__ShouldWork"}, + {testFunction: vision_tools_MathTools__slopeToDegrees__ShouldWork, testName: "vision_tools_MathTools__slopeToDegrees__ShouldWork"}, + {testFunction: vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__sind__ShouldWork, testName: "vision_tools_MathTools__sind__ShouldWork"}, + {testFunction: vision_tools_MathTools__sin__ShouldWork, testName: "vision_tools_MathTools__sin__ShouldWork"}, + {testFunction: vision_tools_MathTools__secd__ShouldWork, testName: "vision_tools_MathTools__secd__ShouldWork"}, + {testFunction: vision_tools_MathTools__sec__ShouldWork, testName: "vision_tools_MathTools__sec__ShouldWork"}, + {testFunction: vision_tools_MathTools__round__ShouldWork, testName: "vision_tools_MathTools__round__ShouldWork"}, + {testFunction: vision_tools_MathTools__radiansToSlope__ShouldWork, testName: "vision_tools_MathTools__radiansToSlope__ShouldWork"}, + {testFunction: vision_tools_MathTools__radiansToDegrees__ShouldWork, testName: "vision_tools_MathTools__radiansToDegrees__ShouldWork"}, + {testFunction: vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__pow__ShouldWork, testName: "vision_tools_MathTools__pow__ShouldWork"}, + {testFunction: vision_tools_MathTools__parseInt__ShouldWork, testName: "vision_tools_MathTools__parseInt__ShouldWork"}, + {testFunction: vision_tools_MathTools__parseFloat__ShouldWork, testName: "vision_tools_MathTools__parseFloat__ShouldWork"}, + {testFunction: vision_tools_MathTools__parseBool__ShouldWork, testName: "vision_tools_MathTools__parseBool__ShouldWork"}, + {testFunction: vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__mirrorInsideRectangle__ShouldWork"}, + {testFunction: vision_tools_MathTools__log__ShouldWork, testName: "vision_tools_MathTools__log__ShouldWork"}, + {testFunction: vision_tools_MathTools__isNaN__ShouldWork, testName: "vision_tools_MathTools__isNaN__ShouldWork"}, + {testFunction: vision_tools_MathTools__isInt__ShouldWork, testName: "vision_tools_MathTools__isInt__ShouldWork"}, + {testFunction: vision_tools_MathTools__isFinite__ShouldWork, testName: "vision_tools_MathTools__isFinite__ShouldWork"}, + {testFunction: vision_tools_MathTools__isBetweenRanges__ShouldWork, testName: "vision_tools_MathTools__isBetweenRanges__ShouldWork"}, + {testFunction: vision_tools_MathTools__isBetweenRange__ShouldWork, testName: "vision_tools_MathTools__isBetweenRange__ShouldWork"}, + {testFunction: vision_tools_MathTools__invertInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__invertInsideRectangle__ShouldWork"}, + {testFunction: vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork"}, + {testFunction: vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork"}, + {testFunction: vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, testName: "vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__gamma__ShouldWork, testName: "vision_tools_MathTools__gamma__ShouldWork"}, + {testFunction: vision_tools_MathTools__fround__ShouldWork, testName: "vision_tools_MathTools__fround__ShouldWork"}, + {testFunction: vision_tools_MathTools__floor__ShouldWork, testName: "vision_tools_MathTools__floor__ShouldWork"}, + {testFunction: vision_tools_MathTools__flipInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__flipInsideRectangle__ShouldWork"}, + {testFunction: vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork"}, + {testFunction: vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork"}, + {testFunction: vision_tools_MathTools__ffloor__ShouldWork, testName: "vision_tools_MathTools__ffloor__ShouldWork"}, + {testFunction: vision_tools_MathTools__fceil__ShouldWork, testName: "vision_tools_MathTools__fceil__ShouldWork"}, + {testFunction: vision_tools_MathTools__factorial__ShouldWork, testName: "vision_tools_MathTools__factorial__ShouldWork"}, + {testFunction: vision_tools_MathTools__exp__ShouldWork, testName: "vision_tools_MathTools__exp__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenRays2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceBetweenPoints__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenPoints__ShouldWork"}, + {testFunction: vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenLines2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__degreesToSlope__ShouldWork, testName: "vision_tools_MathTools__degreesToSlope__ShouldWork"}, + {testFunction: vision_tools_MathTools__degreesToRadians__ShouldWork, testName: "vision_tools_MathTools__degreesToRadians__ShouldWork"}, + {testFunction: vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork"}, + {testFunction: vision_tools_MathTools__cropDecimal__ShouldWork, testName: "vision_tools_MathTools__cropDecimal__ShouldWork"}, + {testFunction: vision_tools_MathTools__cotand__ShouldWork, testName: "vision_tools_MathTools__cotand__ShouldWork"}, + {testFunction: vision_tools_MathTools__cotan__ShouldWork, testName: "vision_tools_MathTools__cotan__ShouldWork"}, + {testFunction: vision_tools_MathTools__cosecd__ShouldWork, testName: "vision_tools_MathTools__cosecd__ShouldWork"}, + {testFunction: vision_tools_MathTools__cosec__ShouldWork, testName: "vision_tools_MathTools__cosec__ShouldWork"}, + {testFunction: vision_tools_MathTools__cosd__ShouldWork, testName: "vision_tools_MathTools__cosd__ShouldWork"}, + {testFunction: vision_tools_MathTools__cos__ShouldWork, testName: "vision_tools_MathTools__cos__ShouldWork"}, + {testFunction: vision_tools_MathTools__clamp__ShouldWork, testName: "vision_tools_MathTools__clamp__ShouldWork"}, + {testFunction: vision_tools_MathTools__ceil__ShouldWork, testName: "vision_tools_MathTools__ceil__ShouldWork"}, + {testFunction: vision_tools_MathTools__boundInt__ShouldWork, testName: "vision_tools_MathTools__boundInt__ShouldWork"}, + {testFunction: vision_tools_MathTools__boundFloat__ShouldWork, testName: "vision_tools_MathTools__boundFloat__ShouldWork"}, + {testFunction: vision_tools_MathTools__atan2__ShouldWork, testName: "vision_tools_MathTools__atan2__ShouldWork"}, + {testFunction: vision_tools_MathTools__atan__ShouldWork, testName: "vision_tools_MathTools__atan__ShouldWork"}, + {testFunction: vision_tools_MathTools__asin__ShouldWork, testName: "vision_tools_MathTools__asin__ShouldWork"}, + {testFunction: vision_tools_MathTools__acos__ShouldWork, testName: "vision_tools_MathTools__acos__ShouldWork"}, + {testFunction: vision_tools_MathTools__abs__ShouldWork, testName: "vision_tools_MathTools__abs__ShouldWork"}, + {testFunction: vision_tools_MathTools__PI__ShouldWork, testName: "vision_tools_MathTools__PI__ShouldWork"}, + {testFunction: vision_tools_MathTools__PI_OVER_2__ShouldWork, testName: "vision_tools_MathTools__PI_OVER_2__ShouldWork"}, + {testFunction: vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork"}, + {testFunction: vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork"}, + {testFunction: vision_tools_MathTools__NaN__ShouldWork, testName: "vision_tools_MathTools__NaN__ShouldWork"}, + {testFunction: vision_tools_MathTools__SQRT2__ShouldWork, testName: "vision_tools_MathTools__SQRT2__ShouldWork"}, + {testFunction: vision_tools_MathTools__SQRT3__ShouldWork, testName: "vision_tools_MathTools__SQRT3__ShouldWork"}]; + + public function new() {} } \ No newline at end of file diff --git a/tests/generated/TestResult.hx b/tests/generated/TestResult.hx new file mode 100644 index 00000000..a48cdfd5 --- /dev/null +++ b/tests/generated/TestResult.hx @@ -0,0 +1,8 @@ +package; + +typedef TestResult = { + testName:String, + result: Dynamic, + expected: Dynamic, + success:Bool +} \ No newline at end of file diff --git a/tests/generator/src/Generator.hx b/tests/generator/src/Generator.hx index 8337fdc0..8d247777 100644 --- a/tests/generator/src/Generator.hx +++ b/tests/generator/src/Generator.hx @@ -72,7 +72,7 @@ class Generator { } static function generateFileHeader(packageName:String, className:String) { - return 'package;\n\nimport vision.exceptions.Unimplemented;\n\nclass ${className} {\n'; + return 'package;\n\nimport vision.exceptions.Unimplemented;\nimport TestResult;\n\nclass ${className} {\n'; } static function generateFileFooter() { @@ -106,7 +106,7 @@ class Generator { functionNames.push('${cleanPackage}__${field}__ShouldWork'); } - functionNames = functionNames.map(x -> '{testFunction: $x, testName: "$x"}'); + functionNames = functionNames.map(x -> '\n\t\t{testFunction: $x, testName: "$x"}'); return testClassActuatorTemplate.replace("TEST_ARRAY", functionNames.join(", ")); } diff --git a/tests/generator/templates/TestClassActuator.hx b/tests/generator/templates/TestClassActuator.hx index 7a599c89..f58b9b22 100644 --- a/tests/generator/templates/TestClassActuator.hx +++ b/tests/generator/templates/TestClassActuator.hx @@ -1,19 +1,3 @@ - public function new() { - var succeed = []; - var failed = []; - var skipped = []; - for (test in [TEST_ARRAY]) { - try { - test.testFunction(); - } - catch (exception:Unimplemented) { - skipped.push(test.testName); - continue; - } - catch (exception:Exception) { - failed.push(test.testName); - continue; - } - succeed.push(test.testName); - } - } \ No newline at end of file + public var tests = [TEST_ARRAY]; + + public function new() {} \ No newline at end of file From f4a9e531c3527718de16f9263c472cddc437c4d4 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Wed, 4 Jun 2025 22:04:39 +0300 Subject: [PATCH 18/32] Holy moly lots of progress! well the generator + detector are pretty much done, maybe some modifications to the way they overwrite stuff and thats it! --- tests/compile.hxml | 6 + tests/generated/IntPoint2D.test.hx | 105 -- tests/generated/MathTools.test.hx | 1180 --------------- tests/{generator => generated}/compile.hxml | 2 +- tests/generated/src/Main.hx | 78 + tests/generated/src/TestConclusion.hx | 5 + tests/generated/{ => src}/TestResult.hx | 6 +- tests/generated/src/TestStatus.hx | 9 + tests/generated/src/tests/IntPoint2DTests.hx | 120 ++ tests/generated/src/tests/MathToolsTests.hx | 1348 +++++++++++++++++ tests/generator/{src => }/Detector.hx | 26 +- tests/generator/{src => }/Generator.hx | 55 +- tests/generator/Main.hx | 8 + tests/generator/src/Main.hx | 8 - .../templates/InstanceFieldTestTemplate.hx | 18 +- .../templates/InstanceFunctionTestTemplate.hx | 18 +- .../templates/StaticFieldTestTemplate.hx | 16 +- .../templates/StaticFunctionTestTemplate.hx | 16 +- .../generator/templates/TestClassActuator.hx | 4 +- tests/generator/templates/TestClassHeader.hx | 9 + tests/generator/templates/doc.hx | 1 + .../generator/{src => }/testing/TestResult.hx | 0 22 files changed, 1690 insertions(+), 1348 deletions(-) create mode 100644 tests/compile.hxml delete mode 100644 tests/generated/IntPoint2D.test.hx delete mode 100644 tests/generated/MathTools.test.hx rename tests/{generator => generated}/compile.hxml (84%) create mode 100644 tests/generated/src/Main.hx create mode 100644 tests/generated/src/TestConclusion.hx rename tests/generated/{ => src}/TestResult.hx (61%) create mode 100644 tests/generated/src/TestStatus.hx create mode 100644 tests/generated/src/tests/IntPoint2DTests.hx create mode 100644 tests/generated/src/tests/MathToolsTests.hx rename tests/generator/{src => }/Detector.hx (78%) rename tests/generator/{src => }/Generator.hx (66%) create mode 100644 tests/generator/Main.hx delete mode 100644 tests/generator/src/Main.hx create mode 100644 tests/generator/templates/TestClassHeader.hx rename tests/generator/{src => }/testing/TestResult.hx (100%) diff --git a/tests/compile.hxml b/tests/compile.hxml new file mode 100644 index 00000000..d89a5416 --- /dev/null +++ b/tests/compile.hxml @@ -0,0 +1,6 @@ +--class-path generator +--main Main + +--library vision + +--interp \ No newline at end of file diff --git a/tests/generated/IntPoint2D.test.hx b/tests/generated/IntPoint2D.test.hx deleted file mode 100644 index b281c3bb..00000000 --- a/tests/generated/IntPoint2D.test.hx +++ /dev/null @@ -1,105 +0,0 @@ -package; - -import vision.exceptions.Unimplemented; -import TestResult; - -class IntPoint2D { - public function vision_ds_IntPoint2D__x__ShouldWork():TestResult { - - var object = new vision.ds.IntPoint2D(); - var result = object.x; - - throw new Unimplemented("vision_ds_IntPoint2D__x__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D#x", - result: result, - expected: null, - success: null - } - } - - public function vision_ds_IntPoint2D__y__ShouldWork():TestResult { - - var object = new vision.ds.IntPoint2D(); - var result = object.y; - - throw new Unimplemented("vision_ds_IntPoint2D__y__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D#y", - result: result, - expected: null, - success: null - } - } - - public function vision_ds_IntPoint2D__fromPoint2D__ShouldWork():TestResult { - - var result = vision.ds.IntPoint2D.fromPoint2D(null); - - throw new Unimplemented("vision_ds_IntPoint2D__fromPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D.fromPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { - - var object = new vision.ds.IntPoint2D(); - var result = object.radiansTo(X6); - - throw new Unimplemented("vision_ds_IntPoint2D__radiansTo__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D#radiansTo", - result: result, - expected: null, - success: null - } - } - - public function vision_ds_IntPoint2D__distanceTo__ShouldWork():TestResult { - - var object = new vision.ds.IntPoint2D(); - var result = object.distanceTo(X6); - - throw new Unimplemented("vision_ds_IntPoint2D__distanceTo__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D#distanceTo", - result: result, - expected: null, - success: null - } - } - - public function vision_ds_IntPoint2D__degreesTo__ShouldWork():TestResult { - - var object = new vision.ds.IntPoint2D(); - var result = object.degreesTo(X6); - - throw new Unimplemented("vision_ds_IntPoint2D__degreesTo__ShouldWork Not Implemented"); - - return { - testName: "vision.ds.IntPoint2D#degreesTo", - result: result, - expected: null, - success: null - } - } - - public var tests = [ - {testFunction: vision_ds_IntPoint2D__fromPoint2D__ShouldWork, testName: "vision_ds_IntPoint2D__fromPoint2D__ShouldWork"}, - {testFunction: vision_ds_IntPoint2D__radiansTo__ShouldWork, testName: "vision_ds_IntPoint2D__radiansTo__ShouldWork"}, - {testFunction: vision_ds_IntPoint2D__distanceTo__ShouldWork, testName: "vision_ds_IntPoint2D__distanceTo__ShouldWork"}, - {testFunction: vision_ds_IntPoint2D__degreesTo__ShouldWork, testName: "vision_ds_IntPoint2D__degreesTo__ShouldWork"}, - {testFunction: vision_ds_IntPoint2D__x__ShouldWork, testName: "vision_ds_IntPoint2D__x__ShouldWork"}, - {testFunction: vision_ds_IntPoint2D__y__ShouldWork, testName: "vision_ds_IntPoint2D__y__ShouldWork"}]; - - public function new() {} -} \ No newline at end of file diff --git a/tests/generated/MathTools.test.hx b/tests/generated/MathTools.test.hx deleted file mode 100644 index d6e14f19..00000000 --- a/tests/generated/MathTools.test.hx +++ /dev/null @@ -1,1180 +0,0 @@ -package; - -import vision.exceptions.Unimplemented; -import TestResult; - -class MathTools { - public function vision_tools_MathTools__PI__ShouldWork():TestResult { - - var result = vision.tools.MathTools.PI; - - throw new Unimplemented("vision_tools_MathTools__PI__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.PI", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__PI_OVER_2__ShouldWork():TestResult { - - var result = vision.tools.MathTools.PI_OVER_2; - - throw new Unimplemented("vision_tools_MathTools__PI_OVER_2__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.PI_OVER_2", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork():TestResult { - - var result = vision.tools.MathTools.NEGATIVE_INFINITY; - - throw new Unimplemented("vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.NEGATIVE_INFINITY", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork():TestResult { - - var result = vision.tools.MathTools.POSITIVE_INFINITY; - - throw new Unimplemented("vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.POSITIVE_INFINITY", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__NaN__ShouldWork():TestResult { - - var result = vision.tools.MathTools.NaN; - - throw new Unimplemented("vision_tools_MathTools__NaN__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.NaN", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__SQRT2__ShouldWork():TestResult { - - var result = vision.tools.MathTools.SQRT2; - - throw new Unimplemented("vision_tools_MathTools__SQRT2__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.SQRT2", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__SQRT3__ShouldWork():TestResult { - - var result = vision.tools.MathTools.SQRT3; - - throw new Unimplemented("vision_tools_MathTools__SQRT3__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.SQRT3", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__wrapInt__ShouldWork():TestResult { - - var result = vision.tools.MathTools.wrapInt(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__wrapInt__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.wrapInt", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__wrapFloat__ShouldWork():TestResult { - - var result = vision.tools.MathTools.wrapFloat(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__wrapFloat__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.wrapFloat", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__truncate__ShouldWork():TestResult { - - var result = vision.tools.MathTools.truncate(null,null); - - throw new Unimplemented("vision_tools_MathTools__truncate__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.truncate", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__toFloat__ShouldWork():TestResult { - - var result = vision.tools.MathTools.toFloat(null); - - throw new Unimplemented("vision_tools_MathTools__toFloat__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.toFloat", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__tand__ShouldWork():TestResult { - - var result = vision.tools.MathTools.tand(null); - - throw new Unimplemented("vision_tools_MathTools__tand__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.tand", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__tan__ShouldWork():TestResult { - - var result = vision.tools.MathTools.tan(null); - - throw new Unimplemented("vision_tools_MathTools__tan__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.tan", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__sqrt__ShouldWork():TestResult { - - var result = vision.tools.MathTools.sqrt(null); - - throw new Unimplemented("vision_tools_MathTools__sqrt__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.sqrt", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__slopeToRadians__ShouldWork():TestResult { - - var result = vision.tools.MathTools.slopeToRadians(null); - - throw new Unimplemented("vision_tools_MathTools__slopeToRadians__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.slopeToRadians", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__slopeToDegrees__ShouldWork():TestResult { - - var result = vision.tools.MathTools.slopeToDegrees(null); - - throw new Unimplemented("vision_tools_MathTools__slopeToDegrees__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.slopeToDegrees", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.slopeFromPointToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__sind__ShouldWork():TestResult { - - var result = vision.tools.MathTools.sind(null); - - throw new Unimplemented("vision_tools_MathTools__sind__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.sind", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__sin__ShouldWork():TestResult { - - var result = vision.tools.MathTools.sin(null); - - throw new Unimplemented("vision_tools_MathTools__sin__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.sin", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__secd__ShouldWork():TestResult { - - var result = vision.tools.MathTools.secd(null); - - throw new Unimplemented("vision_tools_MathTools__secd__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.secd", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__sec__ShouldWork():TestResult { - - var result = vision.tools.MathTools.sec(null); - - throw new Unimplemented("vision_tools_MathTools__sec__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.sec", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__round__ShouldWork():TestResult { - - var result = vision.tools.MathTools.round(null); - - throw new Unimplemented("vision_tools_MathTools__round__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.round", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { - - var result = vision.tools.MathTools.radiansToSlope(null); - - throw new Unimplemented("vision_tools_MathTools__radiansToSlope__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.radiansToSlope", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__radiansToDegrees__ShouldWork():TestResult { - - var result = vision.tools.MathTools.radiansToDegrees(null); - - throw new Unimplemented("vision_tools_MathTools__radiansToDegrees__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.radiansToDegrees", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.radiansFromPointToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.radiansFromPointToLine2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.radiansFromPointToLine2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.radiansFromLineToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.radiansFromLineToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__pow__ShouldWork():TestResult { - - var result = vision.tools.MathTools.pow(null,null); - - throw new Unimplemented("vision_tools_MathTools__pow__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.pow", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__parseInt__ShouldWork():TestResult { - - var result = vision.tools.MathTools.parseInt(null); - - throw new Unimplemented("vision_tools_MathTools__parseInt__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.parseInt", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__parseFloat__ShouldWork():TestResult { - - var result = vision.tools.MathTools.parseFloat(null); - - throw new Unimplemented("vision_tools_MathTools__parseFloat__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.parseFloat", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__parseBool__ShouldWork():TestResult { - - var result = vision.tools.MathTools.parseBool(null); - - throw new Unimplemented("vision_tools_MathTools__parseBool__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.parseBool", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__mirrorInsideRectangle__ShouldWork():TestResult { - - var result = vision.tools.MathTools.mirrorInsideRectangle(null,null); - - throw new Unimplemented("vision_tools_MathTools__mirrorInsideRectangle__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.mirrorInsideRectangle", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__log__ShouldWork():TestResult { - - var result = vision.tools.MathTools.log(null); - - throw new Unimplemented("vision_tools_MathTools__log__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.log", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__isNaN__ShouldWork():TestResult { - - var result = vision.tools.MathTools.isNaN(null); - - throw new Unimplemented("vision_tools_MathTools__isNaN__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.isNaN", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__isInt__ShouldWork():TestResult { - - var result = vision.tools.MathTools.isInt(null); - - throw new Unimplemented("vision_tools_MathTools__isInt__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.isInt", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__isFinite__ShouldWork():TestResult { - - var result = vision.tools.MathTools.isFinite(null); - - throw new Unimplemented("vision_tools_MathTools__isFinite__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.isFinite", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__isBetweenRanges__ShouldWork():TestResult { - - var result = vision.tools.MathTools.isBetweenRanges(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__isBetweenRanges__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.isBetweenRanges", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__isBetweenRange__ShouldWork():TestResult { - - var result = vision.tools.MathTools.isBetweenRange(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__isBetweenRange__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.isBetweenRange", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__invertInsideRectangle__ShouldWork():TestResult { - - var result = vision.tools.MathTools.invertInsideRectangle(null,null); - - throw new Unimplemented("vision_tools_MathTools__invertInsideRectangle__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.invertInsideRectangle", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork():TestResult { - - var result = vision.tools.MathTools.intersectionBetweenRay2Ds(null,null); - - throw new Unimplemented("vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork():TestResult { - - var result = vision.tools.MathTools.intersectionBetweenLine2Ds(null,null); - - throw new Unimplemented("vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.getClosestPointOnRay2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.getClosestPointOnRay2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__gamma__ShouldWork():TestResult { - - var result = vision.tools.MathTools.gamma(null); - - throw new Unimplemented("vision_tools_MathTools__gamma__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.gamma", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__fround__ShouldWork():TestResult { - - var result = vision.tools.MathTools.fround(null); - - throw new Unimplemented("vision_tools_MathTools__fround__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.fround", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__floor__ShouldWork():TestResult { - - var result = vision.tools.MathTools.floor(null); - - throw new Unimplemented("vision_tools_MathTools__floor__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.floor", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__flipInsideRectangle__ShouldWork():TestResult { - - var result = vision.tools.MathTools.flipInsideRectangle(null,null); - - throw new Unimplemented("vision_tools_MathTools__flipInsideRectangle__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.flipInsideRectangle", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork():TestResult { - - var result = vision.tools.MathTools.findPointAtDistanceUsingY(null,null,null,null); - - throw new Unimplemented("vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingY", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork():TestResult { - - var result = vision.tools.MathTools.findPointAtDistanceUsingX(null,null,null,null); - - throw new Unimplemented("vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingX", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__ffloor__ShouldWork():TestResult { - - var result = vision.tools.MathTools.ffloor(null); - - throw new Unimplemented("vision_tools_MathTools__ffloor__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.ffloor", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__fceil__ShouldWork():TestResult { - - var result = vision.tools.MathTools.fceil(null); - - throw new Unimplemented("vision_tools_MathTools__fceil__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.fceil", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__factorial__ShouldWork():TestResult { - - var result = vision.tools.MathTools.factorial(null); - - throw new Unimplemented("vision_tools_MathTools__factorial__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.factorial", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__exp__ShouldWork():TestResult { - - var result = vision.tools.MathTools.exp(null); - - throw new Unimplemented("vision_tools_MathTools__exp__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.exp", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceFromRayToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceFromRayToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceFromPointToRay2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceFromPointToRay2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceFromPointToLine2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceFromPointToLine2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceFromLineToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceFromLineToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceBetweenRays2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceBetweenRays2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceBetweenRays2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceBetweenRays2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceBetweenPoints__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceBetweenPoints(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceBetweenPoints__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__distanceBetweenLines2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.distanceBetweenLines2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__distanceBetweenLines2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.distanceBetweenLines2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__degreesToSlope__ShouldWork():TestResult { - - var result = vision.tools.MathTools.degreesToSlope(null); - - throw new Unimplemented("vision_tools_MathTools__degreesToSlope__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.degreesToSlope", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__degreesToRadians__ShouldWork():TestResult { - - var result = vision.tools.MathTools.degreesToRadians(null); - - throw new Unimplemented("vision_tools_MathTools__degreesToRadians__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.degreesToRadians", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork():TestResult { - - var result = vision.tools.MathTools.degreesFromPointToPoint2D(null,null); - - throw new Unimplemented("vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cropDecimal__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cropDecimal(null); - - throw new Unimplemented("vision_tools_MathTools__cropDecimal__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cropDecimal", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cotand__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cotand(null); - - throw new Unimplemented("vision_tools_MathTools__cotand__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cotand", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cotan__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cotan(null); - - throw new Unimplemented("vision_tools_MathTools__cotan__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cotan", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cosecd__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cosecd(null); - - throw new Unimplemented("vision_tools_MathTools__cosecd__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cosecd", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cosec__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cosec(null); - - throw new Unimplemented("vision_tools_MathTools__cosec__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cosec", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cosd__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cosd(null); - - throw new Unimplemented("vision_tools_MathTools__cosd__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cosd", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__cos__ShouldWork():TestResult { - - var result = vision.tools.MathTools.cos(null); - - throw new Unimplemented("vision_tools_MathTools__cos__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.cos", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__clamp__ShouldWork():TestResult { - - var result = vision.tools.MathTools.clamp(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__clamp__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.clamp", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__ceil__ShouldWork():TestResult { - - var result = vision.tools.MathTools.ceil(null); - - throw new Unimplemented("vision_tools_MathTools__ceil__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.ceil", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__boundInt__ShouldWork():TestResult { - - var result = vision.tools.MathTools.boundInt(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__boundInt__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.boundInt", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__boundFloat__ShouldWork():TestResult { - - var result = vision.tools.MathTools.boundFloat(null,null,null); - - throw new Unimplemented("vision_tools_MathTools__boundFloat__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.boundFloat", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__atan2__ShouldWork():TestResult { - - var result = vision.tools.MathTools.atan2(null,null); - - throw new Unimplemented("vision_tools_MathTools__atan2__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.atan2", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__atan__ShouldWork():TestResult { - - var result = vision.tools.MathTools.atan(null); - - throw new Unimplemented("vision_tools_MathTools__atan__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.atan", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__asin__ShouldWork():TestResult { - - var result = vision.tools.MathTools.asin(null); - - throw new Unimplemented("vision_tools_MathTools__asin__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.asin", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__acos__ShouldWork():TestResult { - - var result = vision.tools.MathTools.acos(null); - - throw new Unimplemented("vision_tools_MathTools__acos__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.acos", - result: result, - expected: null, - success: null - } - } - - public function vision_tools_MathTools__abs__ShouldWork():TestResult { - - var result = vision.tools.MathTools.abs(null); - - throw new Unimplemented("vision_tools_MathTools__abs__ShouldWork Not Implemented"); - - return { - testName: "vision.tools.MathTools.abs", - result: result, - expected: null, - success: null - } - } - - public var tests = [ - {testFunction: vision_tools_MathTools__wrapInt__ShouldWork, testName: "vision_tools_MathTools__wrapInt__ShouldWork"}, - {testFunction: vision_tools_MathTools__wrapFloat__ShouldWork, testName: "vision_tools_MathTools__wrapFloat__ShouldWork"}, - {testFunction: vision_tools_MathTools__truncate__ShouldWork, testName: "vision_tools_MathTools__truncate__ShouldWork"}, - {testFunction: vision_tools_MathTools__toFloat__ShouldWork, testName: "vision_tools_MathTools__toFloat__ShouldWork"}, - {testFunction: vision_tools_MathTools__tand__ShouldWork, testName: "vision_tools_MathTools__tand__ShouldWork"}, - {testFunction: vision_tools_MathTools__tan__ShouldWork, testName: "vision_tools_MathTools__tan__ShouldWork"}, - {testFunction: vision_tools_MathTools__sqrt__ShouldWork, testName: "vision_tools_MathTools__sqrt__ShouldWork"}, - {testFunction: vision_tools_MathTools__slopeToRadians__ShouldWork, testName: "vision_tools_MathTools__slopeToRadians__ShouldWork"}, - {testFunction: vision_tools_MathTools__slopeToDegrees__ShouldWork, testName: "vision_tools_MathTools__slopeToDegrees__ShouldWork"}, - {testFunction: vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__sind__ShouldWork, testName: "vision_tools_MathTools__sind__ShouldWork"}, - {testFunction: vision_tools_MathTools__sin__ShouldWork, testName: "vision_tools_MathTools__sin__ShouldWork"}, - {testFunction: vision_tools_MathTools__secd__ShouldWork, testName: "vision_tools_MathTools__secd__ShouldWork"}, - {testFunction: vision_tools_MathTools__sec__ShouldWork, testName: "vision_tools_MathTools__sec__ShouldWork"}, - {testFunction: vision_tools_MathTools__round__ShouldWork, testName: "vision_tools_MathTools__round__ShouldWork"}, - {testFunction: vision_tools_MathTools__radiansToSlope__ShouldWork, testName: "vision_tools_MathTools__radiansToSlope__ShouldWork"}, - {testFunction: vision_tools_MathTools__radiansToDegrees__ShouldWork, testName: "vision_tools_MathTools__radiansToDegrees__ShouldWork"}, - {testFunction: vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__pow__ShouldWork, testName: "vision_tools_MathTools__pow__ShouldWork"}, - {testFunction: vision_tools_MathTools__parseInt__ShouldWork, testName: "vision_tools_MathTools__parseInt__ShouldWork"}, - {testFunction: vision_tools_MathTools__parseFloat__ShouldWork, testName: "vision_tools_MathTools__parseFloat__ShouldWork"}, - {testFunction: vision_tools_MathTools__parseBool__ShouldWork, testName: "vision_tools_MathTools__parseBool__ShouldWork"}, - {testFunction: vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__mirrorInsideRectangle__ShouldWork"}, - {testFunction: vision_tools_MathTools__log__ShouldWork, testName: "vision_tools_MathTools__log__ShouldWork"}, - {testFunction: vision_tools_MathTools__isNaN__ShouldWork, testName: "vision_tools_MathTools__isNaN__ShouldWork"}, - {testFunction: vision_tools_MathTools__isInt__ShouldWork, testName: "vision_tools_MathTools__isInt__ShouldWork"}, - {testFunction: vision_tools_MathTools__isFinite__ShouldWork, testName: "vision_tools_MathTools__isFinite__ShouldWork"}, - {testFunction: vision_tools_MathTools__isBetweenRanges__ShouldWork, testName: "vision_tools_MathTools__isBetweenRanges__ShouldWork"}, - {testFunction: vision_tools_MathTools__isBetweenRange__ShouldWork, testName: "vision_tools_MathTools__isBetweenRange__ShouldWork"}, - {testFunction: vision_tools_MathTools__invertInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__invertInsideRectangle__ShouldWork"}, - {testFunction: vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork"}, - {testFunction: vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, testName: "vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork"}, - {testFunction: vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, testName: "vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__gamma__ShouldWork, testName: "vision_tools_MathTools__gamma__ShouldWork"}, - {testFunction: vision_tools_MathTools__fround__ShouldWork, testName: "vision_tools_MathTools__fround__ShouldWork"}, - {testFunction: vision_tools_MathTools__floor__ShouldWork, testName: "vision_tools_MathTools__floor__ShouldWork"}, - {testFunction: vision_tools_MathTools__flipInsideRectangle__ShouldWork, testName: "vision_tools_MathTools__flipInsideRectangle__ShouldWork"}, - {testFunction: vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork"}, - {testFunction: vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, testName: "vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork"}, - {testFunction: vision_tools_MathTools__ffloor__ShouldWork, testName: "vision_tools_MathTools__ffloor__ShouldWork"}, - {testFunction: vision_tools_MathTools__fceil__ShouldWork, testName: "vision_tools_MathTools__fceil__ShouldWork"}, - {testFunction: vision_tools_MathTools__factorial__ShouldWork, testName: "vision_tools_MathTools__factorial__ShouldWork"}, - {testFunction: vision_tools_MathTools__exp__ShouldWork, testName: "vision_tools_MathTools__exp__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, testName: "vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenRays2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceBetweenPoints__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenPoints__ShouldWork"}, - {testFunction: vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, testName: "vision_tools_MathTools__distanceBetweenLines2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__degreesToSlope__ShouldWork, testName: "vision_tools_MathTools__degreesToSlope__ShouldWork"}, - {testFunction: vision_tools_MathTools__degreesToRadians__ShouldWork, testName: "vision_tools_MathTools__degreesToRadians__ShouldWork"}, - {testFunction: vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, testName: "vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork"}, - {testFunction: vision_tools_MathTools__cropDecimal__ShouldWork, testName: "vision_tools_MathTools__cropDecimal__ShouldWork"}, - {testFunction: vision_tools_MathTools__cotand__ShouldWork, testName: "vision_tools_MathTools__cotand__ShouldWork"}, - {testFunction: vision_tools_MathTools__cotan__ShouldWork, testName: "vision_tools_MathTools__cotan__ShouldWork"}, - {testFunction: vision_tools_MathTools__cosecd__ShouldWork, testName: "vision_tools_MathTools__cosecd__ShouldWork"}, - {testFunction: vision_tools_MathTools__cosec__ShouldWork, testName: "vision_tools_MathTools__cosec__ShouldWork"}, - {testFunction: vision_tools_MathTools__cosd__ShouldWork, testName: "vision_tools_MathTools__cosd__ShouldWork"}, - {testFunction: vision_tools_MathTools__cos__ShouldWork, testName: "vision_tools_MathTools__cos__ShouldWork"}, - {testFunction: vision_tools_MathTools__clamp__ShouldWork, testName: "vision_tools_MathTools__clamp__ShouldWork"}, - {testFunction: vision_tools_MathTools__ceil__ShouldWork, testName: "vision_tools_MathTools__ceil__ShouldWork"}, - {testFunction: vision_tools_MathTools__boundInt__ShouldWork, testName: "vision_tools_MathTools__boundInt__ShouldWork"}, - {testFunction: vision_tools_MathTools__boundFloat__ShouldWork, testName: "vision_tools_MathTools__boundFloat__ShouldWork"}, - {testFunction: vision_tools_MathTools__atan2__ShouldWork, testName: "vision_tools_MathTools__atan2__ShouldWork"}, - {testFunction: vision_tools_MathTools__atan__ShouldWork, testName: "vision_tools_MathTools__atan__ShouldWork"}, - {testFunction: vision_tools_MathTools__asin__ShouldWork, testName: "vision_tools_MathTools__asin__ShouldWork"}, - {testFunction: vision_tools_MathTools__acos__ShouldWork, testName: "vision_tools_MathTools__acos__ShouldWork"}, - {testFunction: vision_tools_MathTools__abs__ShouldWork, testName: "vision_tools_MathTools__abs__ShouldWork"}, - {testFunction: vision_tools_MathTools__PI__ShouldWork, testName: "vision_tools_MathTools__PI__ShouldWork"}, - {testFunction: vision_tools_MathTools__PI_OVER_2__ShouldWork, testName: "vision_tools_MathTools__PI_OVER_2__ShouldWork"}, - {testFunction: vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork"}, - {testFunction: vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, testName: "vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork"}, - {testFunction: vision_tools_MathTools__NaN__ShouldWork, testName: "vision_tools_MathTools__NaN__ShouldWork"}, - {testFunction: vision_tools_MathTools__SQRT2__ShouldWork, testName: "vision_tools_MathTools__SQRT2__ShouldWork"}, - {testFunction: vision_tools_MathTools__SQRT3__ShouldWork, testName: "vision_tools_MathTools__SQRT3__ShouldWork"}]; - - public function new() {} -} \ No newline at end of file diff --git a/tests/generator/compile.hxml b/tests/generated/compile.hxml similarity index 84% rename from tests/generator/compile.hxml rename to tests/generated/compile.hxml index 33667b05..4d5d3b54 100644 --- a/tests/generator/compile.hxml +++ b/tests/generated/compile.hxml @@ -3,4 +3,4 @@ --library vision ---interp \ No newline at end of file +--interp diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx new file mode 100644 index 00000000..3784b0b3 --- /dev/null +++ b/tests/generated/src/Main.hx @@ -0,0 +1,78 @@ +package; + +import haxe.macro.Expr.Constant; +import tests.*; + +import TestStatus; +import TestResult; +import TestConclusion; + +class Main { + public static var testedClasses:Array> = [IntPoint2DTests, MathToolsTests]; + + // ANSI colors + static var RED = "\033[31m"; + static var GREEN = "\033[32m"; + static var YELLOW = "\033[33m"; + static var BLUE = "\033[34m"; + static var MAGENTA = "\033[35m"; + static var CYAN = "\033[36m"; + static var WHITE = "\033[37m"; + static var BLACK = "\033[30m"; + static var LIGHT_BLUE = "\033[94m"; + static var GRAY = "\033[90m"; + static var RESET = "\033[0m"; + + static var BOLD = "\033[1m"; + static var ITALIC = "\033[3m"; + static var UNDERLINE = "\033[4m"; + + static var bulk = true; + + public static function main() { + var i = 0; + var conclusionMap = new Map>(); + + for (statusType in [Success, Failure, Skipped, Unimplemented]) { + conclusionMap.set(statusType, []); + } + + for (cls in testedClasses) { + var testFunctions:Array<() -> TestResult> = Reflect.field(cls, "tests"); + for (func in testFunctions) { + i++; + var result:TestResult = func(); + Sys.println('$CYAN$BOLD Unit Test $i:$RESET $BOLD$ITALIC${getTestPassColor(result.status)}${result.testName}$RESET'); + Sys.println(' - $RESET$BOLD$WHITE Result: $ITALIC${getTestPassColor(result.status)}${result.status}$RESET'); + if (result.status == Failure) { + Sys.println(' - $RESET$BOLD$WHITE Expected:$RESET $ITALIC$GREEN${result.expected}$RESET'); + Sys.println(' - $RESET$BOLD$WHITE Returned:$RESET $ITALIC$RED${result.returned}$RESET'); + } + + conclusionMap.get(result.status).push(result); + if (result.status != Success && !bulk) Sys.exit(1); + Sys.sleep(bulk ? 0.01 : 0.2); + } + } + + if (conclusionMap.get(Success).length == i) { + Sys.println('$GREEN$BOLD🥳 🥳 🥳 All tests passed! 🥳 🥳 🥳$RESET'); + } else { + Sys.println('$RED$BOLD Final Test Status:$RESET'); + Sys.println(' - $RESET$BOLD${getTestPassColor(Success)} ${conclusionMap.get(Success).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Success)} Passed 🥳$RESET'); + Sys.println(' - $RESET$BOLD${getTestPassColor(Failure)} ${conclusionMap.get(Failure).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Failure)} Failed 🥺$RESET'); + Sys.println(' - $RESET$BOLD${getTestPassColor(Skipped)} ${conclusionMap.get(Skipped).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Skipped)} Skipped 🤷‍♀️$RESET'); + Sys.println(' - $RESET$BOLD${getTestPassColor(Unimplemented)} ${conclusionMap.get(Unimplemented).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Unimplemented)} Unimplemented 😬$RESET'); + } + } + + static function getTestPassColor(status:TestStatus):String { + return switch status { + case Success: GREEN; + case Failure: RED; + case Skipped: LIGHT_BLUE; + case Unimplemented: GRAY; + + } + } +} diff --git a/tests/generated/src/TestConclusion.hx b/tests/generated/src/TestConclusion.hx new file mode 100644 index 00000000..7a3a6819 --- /dev/null +++ b/tests/generated/src/TestConclusion.hx @@ -0,0 +1,5 @@ +package; + +typedef TestConclusion = TestResult & { + testNumber:Int, +} \ No newline at end of file diff --git a/tests/generated/TestResult.hx b/tests/generated/src/TestResult.hx similarity index 61% rename from tests/generated/TestResult.hx rename to tests/generated/src/TestResult.hx index a48cdfd5..f27879b2 100644 --- a/tests/generated/TestResult.hx +++ b/tests/generated/src/TestResult.hx @@ -2,7 +2,7 @@ package; typedef TestResult = { testName:String, - result: Dynamic, + returned: Dynamic, expected: Dynamic, - success:Bool -} \ No newline at end of file + status:TestStatus, +} diff --git a/tests/generated/src/TestStatus.hx b/tests/generated/src/TestStatus.hx new file mode 100644 index 00000000..c84e3f2b --- /dev/null +++ b/tests/generated/src/TestStatus.hx @@ -0,0 +1,9 @@ +package; + + +enum abstract TestStatus(String) { + var Success; + var Failure; + var Skipped; + var Unimplemented; +} \ No newline at end of file diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx new file mode 100644 index 00000000..59fe2433 --- /dev/null +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -0,0 +1,120 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.IntPoint2D; +import vision.tools.MathTools; +import vision.ds.Point2D; +import haxe.Int64; + +class IntPoint2DTests { + public static function vision_ds_IntPoint2D__x__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.x; + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#x", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__y__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.y; + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#y", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__fromPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.IntPoint2D.fromPoint2D((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D.fromPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.radiansTo((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#radiansTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.distanceTo((null : IntPoint2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__degreesTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.degreesTo((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#degreesTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_IntPoint2D__fromPoint2D__ShouldWork, + vision_ds_IntPoint2D__radiansTo__ShouldWork, + vision_ds_IntPoint2D__distanceTo__ShouldWork, + vision_ds_IntPoint2D__degreesTo__ShouldWork, + vision_ds_IntPoint2D__x__ShouldWork, + vision_ds_IntPoint2D__y__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx new file mode 100644 index 00000000..74124c9f --- /dev/null +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -0,0 +1,1348 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.tools.MathTools; +import haxe.ds.Either; +import vision.ds.Point3D; +import vision.ds.Matrix2D; +import vision.ds.IntPoint2D; +import haxe.ds.Vector; +import vision.algorithms.Radix; +import haxe.Int64; +import haxe.ds.ArraySort; +import vision.ds.Rectangle; +import vision.ds.Ray2D; +import vision.ds.Line2D; +import vision.ds.Point2D; + +class MathToolsTests { + public static function vision_tools_MathTools__PI__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.PI; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.PI", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__PI_OVER_2__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.PI_OVER_2; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.PI_OVER_2", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.NEGATIVE_INFINITY; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.NEGATIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.POSITIVE_INFINITY; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.POSITIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__NaN__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.NaN; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.NaN", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__SQRT2__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.SQRT2; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.SQRT2", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__SQRT3__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.SQRT3; + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.SQRT3", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__wrapInt__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.wrapInt((null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.wrapInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__wrapFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.wrapFloat((null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.wrapFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__truncate__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.truncate((null : Float), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.truncate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__toFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.toFloat((null : Int64)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.toFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__tand__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.tand((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.tand", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__tan__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.tan((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.tan", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__sqrt__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.sqrt((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.sqrt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__slopeToRadians__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.slopeToRadians((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.slopeToRadians", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__slopeToDegrees__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.slopeToDegrees((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.slopeToDegrees", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.slopeFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__sind__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.sind((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.sind", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__sin__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.sin((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.sin", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__secd__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.secd((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.secd", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__sec__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.sec((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.sec", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__round__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.round((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.round", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.radiansToSlope((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.radiansToSlope", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__radiansToDegrees__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.radiansToDegrees((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.radiansToDegrees", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.radiansFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.radiansFromPointToLine2D((null : IntPoint2D), (null : Line2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.radiansFromLineToPoint2D((null : Line2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.radiansFromLineToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__pow__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.pow((null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.pow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__parseInt__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.parseInt((null : String)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.parseInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__parseFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.parseFloat((null : String)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.parseFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__parseBool__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.parseBool((null : String)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.parseBool", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__mirrorInsideRectangle__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.mirrorInsideRectangle((null : Line2D), (null : Rectangle)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.mirrorInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__log__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.log((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.log", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__isNaN__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.isNaN((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.isNaN", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__isInt__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.isInt((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.isInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__isFinite__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.isFinite((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.isFinite", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__isBetweenRanges__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.isBetweenRanges((null : Float), (null : {start:Float, end:Float})); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.isBetweenRanges", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__isBetweenRange__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.isBetweenRange((null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.isBetweenRange", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__invertInsideRectangle__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.invertInsideRectangle((null : Line2D), (null : Rectangle)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.invertInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.intersectionBetweenRay2Ds((null : Ray2D), (null : Ray2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.intersectionBetweenLine2Ds((null : Line2D), (null : Line2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.getClosestPointOnRay2D((null : IntPoint2D), (null : Ray2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__gamma__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.gamma((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.gamma", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__fround__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.fround((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.fround", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__floor__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.floor((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.floor", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__flipInsideRectangle__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.flipInsideRectangle((null : Line2D), (null : Rectangle)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.flipInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.findPointAtDistanceUsingY((null : Ray2D), (null : Float), (null : Float), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.findPointAtDistanceUsingX((null : Ray2D), (null : Float), (null : Float), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingX", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__ffloor__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.ffloor((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.ffloor", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__fceil__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.fceil((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.fceil", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__factorial__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.factorial((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.factorial", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__exp__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.exp((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.exp", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceFromRayToPoint2D((null : Ray2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceFromRayToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceFromPointToRay2D((null : IntPoint2D), (null : Ray2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceFromPointToLine2D((null : IntPoint2D), (null : Line2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceFromLineToPoint2D((null : Line2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceBetweenRays2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceBetweenRays2D((null : Ray2D), (null : Ray2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceBetweenRays2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceBetweenPoints__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceBetweenPoints((null : Point3D), (null : Point3D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__distanceBetweenLines2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.distanceBetweenLines2D((null : Line2D), (null : Line2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.distanceBetweenLines2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__degreesToSlope__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.degreesToSlope((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.degreesToSlope", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__degreesToRadians__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.degreesToRadians((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.degreesToRadians", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.degreesFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cropDecimal__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cropDecimal((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cropDecimal", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cotand__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cotand((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cotand", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cotan__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cotan((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cotan", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cosecd__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cosecd((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cosecd", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cosec__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cosec((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cosec", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cosd__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cosd((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cosd", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__cos__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.cos((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.cos", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__clamp__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.clamp((null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.clamp", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__ceil__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.ceil((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.ceil", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__boundInt__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.boundInt((null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.boundInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__boundFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.boundFloat((null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.boundFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__atan2__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.atan2((null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.atan2", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__atan__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.atan((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.atan", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__asin__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.asin((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.asin", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__acos__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.acos((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.acos", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__abs__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.abs((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.abs", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_tools_MathTools__wrapInt__ShouldWork, + vision_tools_MathTools__wrapFloat__ShouldWork, + vision_tools_MathTools__truncate__ShouldWork, + vision_tools_MathTools__toFloat__ShouldWork, + vision_tools_MathTools__tand__ShouldWork, + vision_tools_MathTools__tan__ShouldWork, + vision_tools_MathTools__sqrt__ShouldWork, + vision_tools_MathTools__slopeToRadians__ShouldWork, + vision_tools_MathTools__slopeToDegrees__ShouldWork, + vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, + vision_tools_MathTools__sind__ShouldWork, + vision_tools_MathTools__sin__ShouldWork, + vision_tools_MathTools__secd__ShouldWork, + vision_tools_MathTools__sec__ShouldWork, + vision_tools_MathTools__round__ShouldWork, + vision_tools_MathTools__radiansToSlope__ShouldWork, + vision_tools_MathTools__radiansToDegrees__ShouldWork, + vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, + vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, + vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, + vision_tools_MathTools__pow__ShouldWork, + vision_tools_MathTools__parseInt__ShouldWork, + vision_tools_MathTools__parseFloat__ShouldWork, + vision_tools_MathTools__parseBool__ShouldWork, + vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, + vision_tools_MathTools__log__ShouldWork, + vision_tools_MathTools__isNaN__ShouldWork, + vision_tools_MathTools__isInt__ShouldWork, + vision_tools_MathTools__isFinite__ShouldWork, + vision_tools_MathTools__isBetweenRanges__ShouldWork, + vision_tools_MathTools__isBetweenRange__ShouldWork, + vision_tools_MathTools__invertInsideRectangle__ShouldWork, + vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, + vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, + vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, + vision_tools_MathTools__gamma__ShouldWork, + vision_tools_MathTools__fround__ShouldWork, + vision_tools_MathTools__floor__ShouldWork, + vision_tools_MathTools__flipInsideRectangle__ShouldWork, + vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, + vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, + vision_tools_MathTools__ffloor__ShouldWork, + vision_tools_MathTools__fceil__ShouldWork, + vision_tools_MathTools__factorial__ShouldWork, + vision_tools_MathTools__exp__ShouldWork, + vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, + vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, + vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, + vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, + vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, + vision_tools_MathTools__distanceBetweenPoints__ShouldWork, + vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, + vision_tools_MathTools__degreesToSlope__ShouldWork, + vision_tools_MathTools__degreesToRadians__ShouldWork, + vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, + vision_tools_MathTools__cropDecimal__ShouldWork, + vision_tools_MathTools__cotand__ShouldWork, + vision_tools_MathTools__cotan__ShouldWork, + vision_tools_MathTools__cosecd__ShouldWork, + vision_tools_MathTools__cosec__ShouldWork, + vision_tools_MathTools__cosd__ShouldWork, + vision_tools_MathTools__cos__ShouldWork, + vision_tools_MathTools__clamp__ShouldWork, + vision_tools_MathTools__ceil__ShouldWork, + vision_tools_MathTools__boundInt__ShouldWork, + vision_tools_MathTools__boundFloat__ShouldWork, + vision_tools_MathTools__atan2__ShouldWork, + vision_tools_MathTools__atan__ShouldWork, + vision_tools_MathTools__asin__ShouldWork, + vision_tools_MathTools__acos__ShouldWork, + vision_tools_MathTools__abs__ShouldWork, + vision_tools_MathTools__PI__ShouldWork, + vision_tools_MathTools__PI_OVER_2__ShouldWork, + vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, + vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, + vision_tools_MathTools__NaN__ShouldWork, + vision_tools_MathTools__SQRT2__ShouldWork, + vision_tools_MathTools__SQRT3__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generator/src/Detector.hx b/tests/generator/Detector.hx similarity index 78% rename from tests/generator/src/Detector.hx rename to tests/generator/Detector.hx index 406f9fb0..727b42a8 100644 --- a/tests/generator/src/Detector.hx +++ b/tests/generator/Detector.hx @@ -6,12 +6,13 @@ import sys.FileSystem; class Detector { static var packageFinder = ~/^package ([\w.]+)/m; + static var importFinder = ~/^import ([\w.]+)/m; static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; static var staticFieldFinder = ~/(?:public static inline|public inline static|inline public static|public static) (?:var|final) (\w+)\(get, \w+\)/m; static var instanceFieldFinder = ~/(?:public inline|inline public|public) (?:var|final) (\w+)\(get, \w+\)/m; static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; - + static var constructorFinder = ~/function new\s*\((.*)\)/; public static function detectOnFile(pathToHaxeFile:String):TestDetections { var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); @@ -21,12 +22,20 @@ class Detector { var packageName = packageFinder.matched(1); fileContent = packageFinder.matchedRight(); + var imports = []; + while (importFinder.match(fileContent)) { + var classPath = importFinder.matched(1); + fileContent = importFinder.matchedRight(); + imports.push(classPath); + } + classNameFinder.match(fileContent); var className = classNameFinder.matched(1); fileContent = classNameFinder.matchedRight(); originalFileContent = fileContent; + var staticFunctions = new Map(); while (staticFunctionFinder.match(fileContent)) { var functionName = staticFunctionFinder.matched(1); @@ -68,20 +77,33 @@ class Detector { instanceFields.push(fieldName); } + fileContent = originalFileContent; + trace(originalFileContent); + var constructorParameters = []; + while (constructorFinder.match(fileContent)) { + var parameters = constructorFinder.matched(1); + fileContent = constructorFinder.matchedRight(); + constructorParameters.push(parameters); + } + return { packageName: packageName, + imports: imports, className: className, staticFunctions: staticFunctions, staticFields: staticFields, instanceFunctions: instanceFunctions, - instanceFields: instanceFields + instanceFields: instanceFields, + constructorParameters: constructorParameters } } } typedef TestDetections = { packageName:String, + imports:Array, className:String, + constructorParameters:Array, staticFunctions:Map, staticFields:Array, instanceFunctions:Map, diff --git a/tests/generator/src/Generator.hx b/tests/generator/Generator.hx similarity index 66% rename from tests/generator/src/Generator.hx rename to tests/generator/Generator.hx index 8d247777..c21038ec 100644 --- a/tests/generator/src/Generator.hx +++ b/tests/generator/Generator.hx @@ -10,19 +10,22 @@ using StringTools; class Generator { - public static var instanceFunctionTemplate = File.getContent(FileSystem.absolutePath("templates/InstanceFunctionTestTemplate.hx")); - public static var instanceFieldTemplate = File.getContent(FileSystem.absolutePath("templates/InstanceFieldTestTemplate.hx")); + public static var instanceFunctionTemplate = File.getContent(FileSystem.absolutePath("generator/templates/InstanceFunctionTestTemplate.hx")); + public static var instanceFieldTemplate = File.getContent(FileSystem.absolutePath("generator/templates/InstanceFieldTestTemplate.hx")); - public static var staticFunctionTemplate = File.getContent(FileSystem.absolutePath("templates/StaticFunctionTestTemplate.hx")); - public static var staticFieldTemplate = File.getContent(FileSystem.absolutePath("templates/StaticFieldTestTemplate.hx")); + public static var staticFunctionTemplate = File.getContent(FileSystem.absolutePath("generator/templates/StaticFunctionTestTemplate.hx")); + public static var staticFieldTemplate = File.getContent(FileSystem.absolutePath("generator/templates/StaticFieldTestTemplate.hx")); - public static var testClassActuatorTemplate = File.getContent(FileSystem.absolutePath("templates/TestClassActuator.hx")); + public static var testClassActuatorTemplate = File.getContent(FileSystem.absolutePath("generator/templates/TestClassActuator.hx")); + public static var testClassHeaderTemplate = File.getContent(FileSystem.absolutePath("generator/templates/TestClassHeader.hx")); public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String) { var detections = Detector.detectOnFile(pathToHaxeFile); var file = File.write(FileSystem.absolutePath(pathToOutputFile)); - file.writeString(generateFileHeader(detections.packageName, detections.className)); + file.writeString(generateFileHeader(detections.packageName, detections.className, detections.imports)); + + trace(detections); for (field in detections.staticFields) { file.writeString(generateTest(staticFieldTemplate, { @@ -38,29 +41,29 @@ class Generator { packageName: detections.packageName, className: detections.className, fieldName: field, - testGoal: "ShouldWork" + testGoal: "ShouldWork", + constructorParameters: extractParameters(detections.constructorParameters[0]) })); } for (method => parameters in detections.staticFunctions) { - var nulledOutParameters = parameters.split(",").map(x -> "null").join(","); file.writeString(generateTest(staticFunctionTemplate, { packageName: detections.packageName, className: detections.className, fieldName: method, testGoal: "ShouldWork", - parameters: nulledOutParameters + parameters: extractParameters(parameters) })); } for (method => parameters in detections.instanceFunctions) { - var nulledOutParameters = parameters.split(",").map(x -> "null").join(","); file.writeString(generateTest(instanceFunctionTemplate, { packageName: detections.packageName, className: detections.className, fieldName: method, testGoal: "ShouldWork", - parameters: nulledOutParameters + parameters: extractParameters(parameters), + constructorParameters: extractParameters(detections.constructorParameters[0]) })); } @@ -71,8 +74,11 @@ class Generator { file.close(); } - static function generateFileHeader(packageName:String, className:String) { - return 'package;\n\nimport vision.exceptions.Unimplemented;\nimport TestResult;\n\nclass ${className} {\n'; + static function generateFileHeader(packageName:String, className:String, imports:Array):String { + return testClassHeaderTemplate + .replace("CLASS_NAME", className) + .replace("PACKAGE_NAME", packageName) + .replace("ADDITIONAL_IMPORTS", imports.map(classPath -> 'import $classPath;').join("\n")); } static function generateFileFooter() { @@ -82,12 +88,15 @@ class Generator { static function generateTest(template:String, testBase:TestBase):String { var cleanPackage = testBase.packageName.replace(".", "_") + '_${testBase.className}'; testBase.parameters ??= ""; + testBase.constructorParameters ??= ""; return template .replace("X1", cleanPackage) .replace("X2", testBase.fieldName) .replace("X3", testBase.testGoal) .replace("X4", '${testBase.packageName}.${testBase.className}') - .replace("X5", testBase.parameters) + "\n\n"; + .replace("X5", testBase.parameters) + .replace("X6", testBase.constructorParameters) + "\n\n"; + } static function generateConstructor(detections:TestDetections) { @@ -106,10 +115,23 @@ class Generator { functionNames.push('${cleanPackage}__${field}__ShouldWork'); } - functionNames = functionNames.map(x -> '\n\t\t{testFunction: $x, testName: "$x"}'); + functionNames = functionNames.map(x -> '\n\t\t$x'); return testClassActuatorTemplate.replace("TEST_ARRAY", functionNames.join(", ")); } + + + static function extractParameters(parameters:String):String { + var regex = ~/\w+:(\w+|\{.+\},?)/; + var parameterList = []; + while (regex.match(parameters)) { + var type = regex.matched(1); + parameters = regex.matchedRight(); + parameterList.push('(null : $type)'); + } + + return parameterList.join(", "); + } } typedef TestBase = { @@ -117,5 +139,6 @@ typedef TestBase = { className:String, fieldName:String, testGoal:String, - ?parameters:String + ?parameters:String, + ?constructorParameters:String } \ No newline at end of file diff --git a/tests/generator/Main.hx b/tests/generator/Main.hx new file mode 100644 index 00000000..db3b7290 --- /dev/null +++ b/tests/generator/Main.hx @@ -0,0 +1,8 @@ +package; + +class Main { + static function main() { + Generator.generateFromFile("../src/vision/tools/MathTools.hx", "generated/src/tests/MathToolsTests.hx"); + Generator.generateFromFile("../src/vision/ds/IntPoint2D.hx", "generated/src/tests/IntPoint2DTests.hx"); + } +} \ No newline at end of file diff --git a/tests/generator/src/Main.hx b/tests/generator/src/Main.hx deleted file mode 100644 index 0be32bcf..00000000 --- a/tests/generator/src/Main.hx +++ /dev/null @@ -1,8 +0,0 @@ -package; - -class Main { - static function main() { - Generator.generateFromFile("../../src/vision/tools/MathTools.hx", "../generated/MathTools.test.hx"); - Generator.generateFromFile("../../src/vision/ds/IntPoint2D.hx", "../generated/IntPoint2D.test.hx"); - } -} \ No newline at end of file diff --git a/tests/generator/templates/InstanceFieldTestTemplate.hx b/tests/generator/templates/InstanceFieldTestTemplate.hx index 05ae1b40..07a4b55b 100644 --- a/tests/generator/templates/InstanceFieldTestTemplate.hx +++ b/tests/generator/templates/InstanceFieldTestTemplate.hx @@ -1,14 +1,16 @@ - public function X1__X2__X3():TestResult { - - var object = new X4(); - var result = object.X2; - - throw new Unimplemented("X1__X2__X3 Not Implemented"); + public static function X1__X2__X3():TestResult { + var result = null; + try { + var object = new X4(X6); + result = object.X2; + } catch (e) { + + } return { testName: "X4#X2", - result: result, + returned: result, expected: null, - success: null + status: Unimplemented } } \ No newline at end of file diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx index c8bee0a6..3caa2539 100644 --- a/tests/generator/templates/InstanceFunctionTestTemplate.hx +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -1,14 +1,16 @@ - public function X1__X2__X3():TestResult { - - var object = new X4(); - var result = object.X2(X6); - - throw new Unimplemented("X1__X2__X3 Not Implemented"); + public static function X1__X2__X3():TestResult { + var result = null; + try { + var object = new X4(X6); + result = object.X2(X5); + } catch (e) { + + } return { testName: "X4#X2", - result: result, + returned: result, expected: null, - success: null + status: Unimplemented } } \ No newline at end of file diff --git a/tests/generator/templates/StaticFieldTestTemplate.hx b/tests/generator/templates/StaticFieldTestTemplate.hx index 27546f1c..0c153ae3 100644 --- a/tests/generator/templates/StaticFieldTestTemplate.hx +++ b/tests/generator/templates/StaticFieldTestTemplate.hx @@ -1,13 +1,15 @@ - public function X1__X2__X3():TestResult { - - var result = X4.X2; - - throw new Unimplemented("X1__X2__X3 Not Implemented"); + public static function X1__X2__X3():TestResult { + var result = null; + try { + result = X4.X2; + } catch (e) { + + } return { testName: "X4.X2", - result: result, + returned: result, expected: null, - success: null + status: Unimplemented } } \ No newline at end of file diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx index 42308293..293e7f8b 100644 --- a/tests/generator/templates/StaticFunctionTestTemplate.hx +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -1,13 +1,15 @@ - public function X1__X2__X3():TestResult { - - var result = X4.X2(X5); - - throw new Unimplemented("X1__X2__X3 Not Implemented"); + public static function X1__X2__X3():TestResult { + var result = null; + try { + result = X4.X2(X5); + } catch (e) { + + } return { testName: "X4.X2", - result: result, + returned: result, expected: null, - success: null + status: Unimplemented } } \ No newline at end of file diff --git a/tests/generator/templates/TestClassActuator.hx b/tests/generator/templates/TestClassActuator.hx index f58b9b22..5d9e77f4 100644 --- a/tests/generator/templates/TestClassActuator.hx +++ b/tests/generator/templates/TestClassActuator.hx @@ -1,3 +1 @@ - public var tests = [TEST_ARRAY]; - - public function new() {} \ No newline at end of file + public static var tests = [TEST_ARRAY]; \ No newline at end of file diff --git a/tests/generator/templates/TestClassHeader.hx b/tests/generator/templates/TestClassHeader.hx new file mode 100644 index 00000000..08f1c765 --- /dev/null +++ b/tests/generator/templates/TestClassHeader.hx @@ -0,0 +1,9 @@ +package tests; + +import TestResult; +import TestStatus; + +import PACKAGE_NAME.CLASS_NAME; +ADDITIONAL_IMPORTS + +class CLASS_NAMETests { diff --git a/tests/generator/templates/doc.hx b/tests/generator/templates/doc.hx index 83949824..90af1042 100644 --- a/tests/generator/templates/doc.hx +++ b/tests/generator/templates/doc.hx @@ -6,5 +6,6 @@ package templates; `X3` - test goal. Usually starts with "ShouldBe" or "ShouldEqual". `X4` - class name, including full package, for example: `my.example.ClassInstance` `X5` - optional - parameter list for when we test a function + `X6` - optional - parameter list for when we test a constructor **/ public var doc:String; diff --git a/tests/generator/src/testing/TestResult.hx b/tests/generator/testing/TestResult.hx similarity index 100% rename from tests/generator/src/testing/TestResult.hx rename to tests/generator/testing/TestResult.hx From af4c31202b36d51397c62a49e63752eea731d416 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Wed, 4 Jun 2025 23:44:19 +0300 Subject: [PATCH 19/32] There are still some problems with the generator, but i might leave it the way it is since its mostly ok, and requires manual test writing wither way (some classes cause the test pject to throw errors, which is why they are excluded) --- src/vision/ds/Queue.hx | 19 - src/vision/ds/QueueCell.hx | 20 + tests/compile.hxml | 3 + tests/config.json | 28 + tests/generated/compile.hxml | 3 +- tests/generated/src/Main.hx | 2 +- tests/generated/src/tests/Array2DTests.hx | 119 +++ .../src/tests/BilateralFilterTests.hx | 31 + .../src/tests/BilinearInterpolationTests.hx | 49 + tests/generated/src/tests/ByteArrayTests.hx | 230 +++++ tests/generated/src/tests/CannyObjectTests.hx | 11 + tests/generated/src/tests/CannyTests.hx | 98 ++ .../generated/src/tests/ColorClusterTests.hx | 11 + tests/generated/src/tests/ColorTests.hx | 949 ++++++++++++++++++ tests/generated/src/tests/CramerTests.hx | 16 + .../src/tests/FormatImageExporterTests.hx | 73 ++ .../src/tests/FormatImageLoaderTests.hx | 52 + tests/generated/src/tests/GaussJordanTests.hx | 28 + tests/generated/src/tests/GaussTests.hx | 48 + tests/generated/src/tests/HistogramTests.hx | 83 ++ .../generated/src/tests/ImageHashingTests.hx | 50 + tests/generated/src/tests/ImageIOTests.hx | 12 + .../generated/src/tests/Int16Point2DTests.hx | 119 +++ tests/generated/src/tests/IntPoint2DTests.hx | 54 + tests/generated/src/tests/KMeansTests.hx | 14 + tests/generated/src/tests/LaplaceTests.hx | 48 + tests/generated/src/tests/MathToolsTests.hx | 17 + .../src/tests/PerspectiveWarpTests.hx | 29 + tests/generated/src/tests/PerwittTests.hx | 47 + tests/generated/src/tests/PixelTests.hx | 11 + tests/generated/src/tests/Point2DTests.hx | 101 ++ tests/generated/src/tests/Point3DTests.hx | 65 ++ .../src/tests/PointTransformationPairTests.hx | 11 + tests/generated/src/tests/QueueCellTests.hx | 29 + tests/generated/src/tests/RadixTests.hx | 13 + tests/generated/src/tests/RectangleTests.hx | 11 + .../generated/src/tests/RobertsCrossTests.hx | 29 + tests/generated/src/tests/SimpleHoughTests.hx | 30 + .../src/tests/SimpleLineDetectorTests.hx | 49 + tests/generated/src/tests/SobelTests.hx | 47 + .../generated/src/tests/UInt16Point2DTests.hx | 119 +++ tests/generator/Config.hx | 14 + tests/generator/Detector.hx | 17 +- tests/generator/Generator.hx | 16 +- tests/generator/Main.hx | 67 +- 45 files changed, 2858 insertions(+), 34 deletions(-) create mode 100644 src/vision/ds/QueueCell.hx create mode 100644 tests/config.json create mode 100644 tests/generated/src/tests/Array2DTests.hx create mode 100644 tests/generated/src/tests/BilateralFilterTests.hx create mode 100644 tests/generated/src/tests/BilinearInterpolationTests.hx create mode 100644 tests/generated/src/tests/ByteArrayTests.hx create mode 100644 tests/generated/src/tests/CannyObjectTests.hx create mode 100644 tests/generated/src/tests/CannyTests.hx create mode 100644 tests/generated/src/tests/ColorClusterTests.hx create mode 100644 tests/generated/src/tests/ColorTests.hx create mode 100644 tests/generated/src/tests/CramerTests.hx create mode 100644 tests/generated/src/tests/FormatImageExporterTests.hx create mode 100644 tests/generated/src/tests/FormatImageLoaderTests.hx create mode 100644 tests/generated/src/tests/GaussJordanTests.hx create mode 100644 tests/generated/src/tests/GaussTests.hx create mode 100644 tests/generated/src/tests/HistogramTests.hx create mode 100644 tests/generated/src/tests/ImageHashingTests.hx create mode 100644 tests/generated/src/tests/ImageIOTests.hx create mode 100644 tests/generated/src/tests/Int16Point2DTests.hx create mode 100644 tests/generated/src/tests/KMeansTests.hx create mode 100644 tests/generated/src/tests/LaplaceTests.hx create mode 100644 tests/generated/src/tests/PerspectiveWarpTests.hx create mode 100644 tests/generated/src/tests/PerwittTests.hx create mode 100644 tests/generated/src/tests/PixelTests.hx create mode 100644 tests/generated/src/tests/Point2DTests.hx create mode 100644 tests/generated/src/tests/Point3DTests.hx create mode 100644 tests/generated/src/tests/PointTransformationPairTests.hx create mode 100644 tests/generated/src/tests/QueueCellTests.hx create mode 100644 tests/generated/src/tests/RadixTests.hx create mode 100644 tests/generated/src/tests/RectangleTests.hx create mode 100644 tests/generated/src/tests/RobertsCrossTests.hx create mode 100644 tests/generated/src/tests/SimpleHoughTests.hx create mode 100644 tests/generated/src/tests/SimpleLineDetectorTests.hx create mode 100644 tests/generated/src/tests/SobelTests.hx create mode 100644 tests/generated/src/tests/UInt16Point2DTests.hx create mode 100644 tests/generator/Config.hx diff --git a/src/vision/ds/Queue.hx b/src/vision/ds/Queue.hx index c8c4e00f..64c5a2e8 100644 --- a/src/vision/ds/Queue.hx +++ b/src/vision/ds/Queue.hx @@ -1,24 +1,5 @@ package vision.ds; -#if (flash || cpp) @:generic #end -class QueueCell { - public var previous:QueueCell; - - public var value:T; - - public var next:QueueCell; - - public function new(value:T, next:QueueCell, previous:QueueCell) { - this.previous = previous; - this.value = value; - this.next = next; - } - - @:to @:noCompletion public function getValue():T { - return value; - } -} - /** Represents a queue, as a doubly linked list. **/ diff --git a/src/vision/ds/QueueCell.hx b/src/vision/ds/QueueCell.hx new file mode 100644 index 00000000..f8eb7e37 --- /dev/null +++ b/src/vision/ds/QueueCell.hx @@ -0,0 +1,20 @@ +package vision.ds; + +#if (flash || cpp) @:generic #end +class QueueCell { + public var previous:QueueCell; + + public var value:T; + + public var next:QueueCell; + + public function new(value:T, next:QueueCell, previous:QueueCell) { + this.previous = previous; + this.value = value; + this.next = next; + } + + @:to @:noCompletion public function getValue():T { + return value; + } +} \ No newline at end of file diff --git a/tests/compile.hxml b/tests/compile.hxml index d89a5416..39d4971f 100644 --- a/tests/compile.hxml +++ b/tests/compile.hxml @@ -3,4 +3,7 @@ --library vision +--define --regenerate-all +--define --no-overwrite + --interp \ No newline at end of file diff --git a/tests/config.json b/tests/config.json new file mode 100644 index 00000000..328c1829 --- /dev/null +++ b/tests/config.json @@ -0,0 +1,28 @@ +{ + "regenerateAll": true, + "overwrite": true, + "source": "../src/vision", + "exclude": [ + "exceptions/", + "TransformationMatrix2D.hx", + "VisionThread.hx", + "Vision.hx", + "Ray2D.hx", + "Queue.hx", + "Matrix2D.hx", + "Line2D.hx", + "ImageView.hx", + "Image.hx", + "ImageTools.hx", + "ArrayTools.hx", + "Array2DMacro.hx", + "FrameworkImageIO.hx", + "Color.hx", + "ByteArray.hx", + "QueueCell.hx", + "Array2D.hx", + "PerspectiveWarp.hx", + "SimpleHough.hx" + ], + "destination": "./generated/src/tests" +} \ No newline at end of file diff --git a/tests/generated/compile.hxml b/tests/generated/compile.hxml index 4d5d3b54..a5611dc1 100644 --- a/tests/generated/compile.hxml +++ b/tests/generated/compile.hxml @@ -2,5 +2,6 @@ --main Main --library vision +--library format ---interp +--interp \ No newline at end of file diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 3784b0b3..8c84b87d 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -8,7 +8,7 @@ import TestResult; import TestConclusion; class Main { - public static var testedClasses:Array> = [IntPoint2DTests, MathToolsTests]; + public static var testedClasses:Array> = [BilateralFilterTests, BilinearInterpolationTests, CannyTests, CramerTests, GaussTests, GaussJordanTests, ImageHashingTests, KMeansTests, LaplaceTests, PerwittTests, RadixTests, RobertsCrossTests, SimpleLineDetectorTests, SobelTests, CannyObjectTests, HistogramTests, Int16Point2DTests, IntPoint2DTests, ColorClusterTests, PixelTests, Point2DTests, Point3DTests, RectangleTests, PointTransformationPairTests, UInt16Point2DTests, ImageIOTests, FormatImageExporterTests, FormatImageLoaderTests, MathToolsTests]; // ANSI colors static var RED = "\033[31m"; diff --git a/tests/generated/src/tests/Array2DTests.hx b/tests/generated/src/tests/Array2DTests.hx new file mode 100644 index 00000000..50121aa8 --- /dev/null +++ b/tests/generated/src/tests/Array2DTests.hx @@ -0,0 +1,119 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Array2D; + + +class Array2DTests { + public static function vision_ds_Array2D__length__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.length; + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#length", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__setMultiple__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.setMultiple((null : Array), (null : T)); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#setMultiple", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__set__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.set((null : Int), (null : Int), (null : T)); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#set", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__iterator__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.iterator(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#iterator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__get__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); + result = object.get((null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#get", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Array2D__toString__ShouldWork, + vision_ds_Array2D__setMultiple__ShouldWork, + vision_ds_Array2D__set__ShouldWork, + vision_ds_Array2D__iterator__ShouldWork, + vision_ds_Array2D__get__ShouldWork, + vision_ds_Array2D__length__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/BilateralFilterTests.hx b/tests/generated/src/tests/BilateralFilterTests.hx new file mode 100644 index 00000000..a449696f --- /dev/null +++ b/tests/generated/src/tests/BilateralFilterTests.hx @@ -0,0 +1,31 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.BilateralFilter; +import haxe.ds.Vector; +import vision.ds.Color; +import vision.ds.Array2D; +import vision.ds.Image; + +class BilateralFilterTests { + public static function vision_algorithms_BilateralFilter__filter__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.BilateralFilter.filter((null : Image), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.BilateralFilter.filter", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_BilateralFilter__filter__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/BilinearInterpolationTests.hx b/tests/generated/src/tests/BilinearInterpolationTests.hx new file mode 100644 index 00000000..accc07b5 --- /dev/null +++ b/tests/generated/src/tests/BilinearInterpolationTests.hx @@ -0,0 +1,49 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.BilinearInterpolation; +import vision.ds.Color; +import vision.tools.ImageTools; +import vision.exceptions.OutOfBounds; +import vision.ds.Image; +import vision.tools.MathTools.*; + +class BilinearInterpolationTests { + public static function vision_algorithms_BilinearInterpolation__interpolateMissingPixels__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels((null : Image), (null : Int), (null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_BilinearInterpolation__interpolate__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.BilinearInterpolation.interpolate((null : Image), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.BilinearInterpolation.interpolate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_BilinearInterpolation__interpolateMissingPixels__ShouldWork, + vision_algorithms_BilinearInterpolation__interpolate__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx new file mode 100644 index 00000000..e5f1dcd2 --- /dev/null +++ b/tests/generated/src/tests/ByteArrayTests.hx @@ -0,0 +1,230 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.ByteArray; +import haxe.Int64; +import vision.tools.MathTools; +import haxe.Serializer; +import haxe.io.BytesData; +import haxe.io.Bytes; + +class ByteArrayTests { + public static function vision_ds_ByteArray__from__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.ByteArray.from((null : Dynamic)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setUInt8__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.setUInt8((null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setUInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setUInt32__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.setUInt32((null : Int), (null : UInt)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setUInt32", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setInt8__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.setInt8((null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setBytes__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.setBytes((null : Int), (null : ByteArray)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setBytes", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__resize__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.resize((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#resize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__isEmpty__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.isEmpty(); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#isEmpty", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getUInt8__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.getUInt8((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getUInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getUInt32__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.getUInt32((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getUInt32", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getInt8__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.getInt8((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getBytes__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.getBytes((null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getBytes", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__concat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.ByteArray((null : Int), (null : Int)); + result = object.concat((null : ByteArray)); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#concat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_ByteArray__from__ShouldWork, + vision_ds_ByteArray__setUInt8__ShouldWork, + vision_ds_ByteArray__setUInt32__ShouldWork, + vision_ds_ByteArray__setInt8__ShouldWork, + vision_ds_ByteArray__setBytes__ShouldWork, + vision_ds_ByteArray__resize__ShouldWork, + vision_ds_ByteArray__isEmpty__ShouldWork, + vision_ds_ByteArray__getUInt8__ShouldWork, + vision_ds_ByteArray__getUInt32__ShouldWork, + vision_ds_ByteArray__getInt8__ShouldWork, + vision_ds_ByteArray__getBytes__ShouldWork, + vision_ds_ByteArray__concat__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/CannyObjectTests.hx b/tests/generated/src/tests/CannyObjectTests.hx new file mode 100644 index 00000000..ceb24f0f --- /dev/null +++ b/tests/generated/src/tests/CannyObjectTests.hx @@ -0,0 +1,11 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.canny.CannyObject; + + +class CannyObjectTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/CannyTests.hx b/tests/generated/src/tests/CannyTests.hx new file mode 100644 index 00000000..396e8282 --- /dev/null +++ b/tests/generated/src/tests/CannyTests.hx @@ -0,0 +1,98 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Canny; +import vision.ds.Color; +import vision.ds.Image; +import vision.ds.canny.CannyObject; + +class CannyTests { + public static function vision_algorithms_Canny__nonMaxSuppression__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Canny.nonMaxSuppression((null : CannyObject)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Canny.nonMaxSuppression", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Canny__grayscale__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Canny.grayscale((null : CannyObject)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Canny.grayscale", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Canny__applySobelFilters__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Canny.applySobelFilters((null : CannyObject)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Canny.applySobelFilters", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Canny__applyHysteresis__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Canny.applyHysteresis((null : CannyObject), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Canny.applyHysteresis", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Canny__applyGaussian__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Canny.applyGaussian((null : CannyObject), (null : Int), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Canny.applyGaussian", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_Canny__nonMaxSuppression__ShouldWork, + vision_algorithms_Canny__grayscale__ShouldWork, + vision_algorithms_Canny__applySobelFilters__ShouldWork, + vision_algorithms_Canny__applyHysteresis__ShouldWork, + vision_algorithms_Canny__applyGaussian__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/ColorClusterTests.hx b/tests/generated/src/tests/ColorClusterTests.hx new file mode 100644 index 00000000..ae1d4c81 --- /dev/null +++ b/tests/generated/src/tests/ColorClusterTests.hx @@ -0,0 +1,11 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.kmeans.ColorCluster; + + +class ColorClusterTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx new file mode 100644 index 00000000..347d0743 --- /dev/null +++ b/tests/generated/src/tests/ColorTests.hx @@ -0,0 +1,949 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Color; +import vision.tools.ArrayTools; +import vision.tools.MathTools; + +class ColorTests { + public static function vision_ds_Color__red__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.red; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#red", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__blue__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.blue; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#blue", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__green__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.green; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#green", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__alpha__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.alpha; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#alpha", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__redFloat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.redFloat; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#redFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__blueFloat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.blueFloat; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#blueFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__greenFloat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.greenFloat; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#greenFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__alphaFloat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.alphaFloat; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#alphaFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__cyan__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.cyan; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#cyan", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__magenta__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.magenta; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#magenta", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__yellow__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.yellow; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#yellow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__black__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.black; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#black", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__rgb__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.rgb; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#rgb", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__hue__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.hue; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#hue", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__saturation__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.saturation; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#saturation", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__brightness__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.brightness; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#brightness", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__lightness__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.lightness; + } catch (e) { + + } + + return { + testName: "vision.ds.Color#lightness", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__subtract__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.subtract((null : Color), (null : Color)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.subtract", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__multiply__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.multiply((null : Color), (null : Color)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.multiply", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__makeRandom__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.makeRandom((null : Bool), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.makeRandom", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__interpolate__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.interpolate((null : Color), (null : Color), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.interpolate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__getAverage__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.getAverage((null : Array), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.getAverage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromRGBAFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromRGBAFloat((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromRGBAFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromRGBA__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromRGBA((null : Int), (null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromRGBA", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromInt__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromInt((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromHSL__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromHSL((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromHSL", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromHSB__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromHSB((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromHSB", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromFloat__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromFloat((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromCMYK__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.fromCMYK((null : Float), (null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromCMYK", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__from8Bit__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.from8Bit((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.from8Bit", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__divide__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.divide((null : Color), (null : Color)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.divide", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__distanceBetween__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.distanceBetween((null : Color), (null : Color), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.distanceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__differenceBetween__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.differenceBetween((null : Color), (null : Color), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.differenceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__add__ShouldWork():TestResult { + var result = null; + try { + result = vision.ds.Color.add((null : Color), (null : Color)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.add", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__toWebString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.toWebString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#toWebString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__toInt__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.toInt(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__toHexString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.toHexString((null : Bool), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#toHexString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__to24Bit__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.to24Bit(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#to24Bit", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__setRGBAFloat__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.setRGBAFloat((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#setRGBAFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__setRGBA__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.setRGBA((null : Int), (null : Int), (null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#setRGBA", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__setHSL__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.setHSL((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#setHSL", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__setHSB__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.setHSB((null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#setHSB", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__setCMYK__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.setCMYK((null : Float), (null : Float), (null : Float), (null : Float), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#setCMYK", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__lighten__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.lighten((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#lighten", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__invert__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.invert(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#invert", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__grayscale__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.grayscale((null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#grayscale", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__getTriadicHarmony__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.getTriadicHarmony(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#getTriadicHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__getSplitComplementHarmony__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.getSplitComplementHarmony((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#getSplitComplementHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__getComplementHarmony__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.getComplementHarmony(); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#getComplementHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__getAnalogousHarmony__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.getAnalogousHarmony((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#getAnalogousHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__darken__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.darken((null : Float)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#darken", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__blackOrWhite__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Color((null : Int)); + result = object.blackOrWhite((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Color#blackOrWhite", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Color__subtract__ShouldWork, + vision_ds_Color__multiply__ShouldWork, + vision_ds_Color__makeRandom__ShouldWork, + vision_ds_Color__interpolate__ShouldWork, + vision_ds_Color__getAverage__ShouldWork, + vision_ds_Color__fromRGBAFloat__ShouldWork, + vision_ds_Color__fromRGBA__ShouldWork, + vision_ds_Color__fromInt__ShouldWork, + vision_ds_Color__fromHSL__ShouldWork, + vision_ds_Color__fromHSB__ShouldWork, + vision_ds_Color__fromFloat__ShouldWork, + vision_ds_Color__fromCMYK__ShouldWork, + vision_ds_Color__from8Bit__ShouldWork, + vision_ds_Color__divide__ShouldWork, + vision_ds_Color__distanceBetween__ShouldWork, + vision_ds_Color__differenceBetween__ShouldWork, + vision_ds_Color__add__ShouldWork, + vision_ds_Color__toWebString__ShouldWork, + vision_ds_Color__toString__ShouldWork, + vision_ds_Color__toInt__ShouldWork, + vision_ds_Color__toHexString__ShouldWork, + vision_ds_Color__to24Bit__ShouldWork, + vision_ds_Color__setRGBAFloat__ShouldWork, + vision_ds_Color__setRGBA__ShouldWork, + vision_ds_Color__setHSL__ShouldWork, + vision_ds_Color__setHSB__ShouldWork, + vision_ds_Color__setCMYK__ShouldWork, + vision_ds_Color__lighten__ShouldWork, + vision_ds_Color__invert__ShouldWork, + vision_ds_Color__grayscale__ShouldWork, + vision_ds_Color__getTriadicHarmony__ShouldWork, + vision_ds_Color__getSplitComplementHarmony__ShouldWork, + vision_ds_Color__getComplementHarmony__ShouldWork, + vision_ds_Color__getAnalogousHarmony__ShouldWork, + vision_ds_Color__darken__ShouldWork, + vision_ds_Color__blackOrWhite__ShouldWork, + vision_ds_Color__red__ShouldWork, + vision_ds_Color__blue__ShouldWork, + vision_ds_Color__green__ShouldWork, + vision_ds_Color__alpha__ShouldWork, + vision_ds_Color__redFloat__ShouldWork, + vision_ds_Color__blueFloat__ShouldWork, + vision_ds_Color__greenFloat__ShouldWork, + vision_ds_Color__alphaFloat__ShouldWork, + vision_ds_Color__cyan__ShouldWork, + vision_ds_Color__magenta__ShouldWork, + vision_ds_Color__yellow__ShouldWork, + vision_ds_Color__black__ShouldWork, + vision_ds_Color__rgb__ShouldWork, + vision_ds_Color__hue__ShouldWork, + vision_ds_Color__saturation__ShouldWork, + vision_ds_Color__brightness__ShouldWork, + vision_ds_Color__lightness__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/CramerTests.hx b/tests/generated/src/tests/CramerTests.hx new file mode 100644 index 00000000..d4dfd178 --- /dev/null +++ b/tests/generated/src/tests/CramerTests.hx @@ -0,0 +1,16 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Cramer; +import vision.exceptions.InvalidCramerSetup; +import vision.exceptions.InvalidCramerCoefficientsMatrix; +import vision.tools.MathTools; +import vision.ds.Matrix2D; +import haxe.ds.Vector; +import vision.ds.Array2D; + +class CramerTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageExporterTests.hx b/tests/generated/src/tests/FormatImageExporterTests.hx new file mode 100644 index 00000000..4f7d0d79 --- /dev/null +++ b/tests/generated/src/tests/FormatImageExporterTests.hx @@ -0,0 +1,73 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.formats.__internal.FormatImageExporter; +import vision.ds.PixelFormat; +import vision.ds.ByteArray; +import haxe.io.BytesOutput; +import vision.ds.Image; +import vision.ds.ImageFormat; +import vision.exceptions.ImageSavingFailed; +import format.png.Writer; +import format.png.Tools; +import format.bmp.Writer; +import format.bmp.Tools; +import format.jpg.Writer; +import format.jpg.Data; + +class FormatImageExporterTests { + public static function vision_formats___internal_FormatImageExporter__png__ShouldWork():TestResult { + var result = null; + try { + result = vision.formats.__internal.FormatImageExporter.png((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.formats.__internal.FormatImageExporter.png", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_formats___internal_FormatImageExporter__jpeg__ShouldWork():TestResult { + var result = null; + try { + result = vision.formats.__internal.FormatImageExporter.jpeg((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.formats.__internal.FormatImageExporter.jpeg", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_formats___internal_FormatImageExporter__bmp__ShouldWork():TestResult { + var result = null; + try { + result = vision.formats.__internal.FormatImageExporter.bmp((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.formats.__internal.FormatImageExporter.bmp", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_formats___internal_FormatImageExporter__png__ShouldWork, + vision_formats___internal_FormatImageExporter__jpeg__ShouldWork, + vision_formats___internal_FormatImageExporter__bmp__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageLoaderTests.hx b/tests/generated/src/tests/FormatImageLoaderTests.hx new file mode 100644 index 00000000..12cfd37f --- /dev/null +++ b/tests/generated/src/tests/FormatImageLoaderTests.hx @@ -0,0 +1,52 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.formats.__internal.FormatImageLoader; +import haxe.io.BytesInput; +import vision.ds.Image; +import vision.exceptions.ImageLoadingFailed; +import vision.ds.ByteArray; +import format.png.Reader; +import format.png.Tools; +import format.bmp.Reader; +import format.bmp.Tools; + +class FormatImageLoaderTests { + public static function vision_formats___internal_FormatImageLoader__png__ShouldWork():TestResult { + var result = null; + try { + result = vision.formats.__internal.FormatImageLoader.png((null : ByteArray)); + } catch (e) { + + } + + return { + testName: "vision.formats.__internal.FormatImageLoader.png", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_formats___internal_FormatImageLoader__bmp__ShouldWork():TestResult { + var result = null; + try { + result = vision.formats.__internal.FormatImageLoader.bmp((null : ByteArray)); + } catch (e) { + + } + + return { + testName: "vision.formats.__internal.FormatImageLoader.bmp", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_formats___internal_FormatImageLoader__png__ShouldWork, + vision_formats___internal_FormatImageLoader__bmp__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/GaussJordanTests.hx b/tests/generated/src/tests/GaussJordanTests.hx new file mode 100644 index 00000000..78bf9b94 --- /dev/null +++ b/tests/generated/src/tests/GaussJordanTests.hx @@ -0,0 +1,28 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.GaussJordan; +import vision.ds.Matrix2D; + +class GaussJordanTests { + public static function vision_algorithms_GaussJordan__invert__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.GaussJordan.invert((null : Matrix2D)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.GaussJordan.invert", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_GaussJordan__invert__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/GaussTests.hx b/tests/generated/src/tests/GaussTests.hx new file mode 100644 index 00000000..5a931341 --- /dev/null +++ b/tests/generated/src/tests/GaussTests.hx @@ -0,0 +1,48 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Gauss; +import vision.ds.Color; +import vision.ds.Image; +import vision.ds.Array2D; +import vision.exceptions.InvalidGaussianKernelSize; + +class GaussTests { + public static function vision_algorithms_Gauss__fastBlur__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Gauss.fastBlur((null : Image), (null : Int), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.fastBlur", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__createKernelOfSize__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Gauss.createKernelOfSize((null : Int), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.createKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_Gauss__fastBlur__ShouldWork, + vision_algorithms_Gauss__createKernelOfSize__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/HistogramTests.hx b/tests/generated/src/tests/HistogramTests.hx new file mode 100644 index 00000000..6964ce87 --- /dev/null +++ b/tests/generated/src/tests/HistogramTests.hx @@ -0,0 +1,83 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Histogram; +import haxe.ds.IntMap; + +class HistogramTests { + public static function vision_ds_Histogram__length__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Histogram(); + result = object.length; + } catch (e) { + + } + + return { + testName: "vision.ds.Histogram#length", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Histogram__median__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Histogram(); + result = object.median; + } catch (e) { + + } + + return { + testName: "vision.ds.Histogram#median", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Histogram__increment__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Histogram(); + result = object.increment((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Histogram#increment", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Histogram__decrement__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Histogram(); + result = object.decrement((null : Int)); + } catch (e) { + + } + + return { + testName: "vision.ds.Histogram#decrement", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Histogram__increment__ShouldWork, + vision_ds_Histogram__decrement__ShouldWork, + vision_ds_Histogram__length__ShouldWork, + vision_ds_Histogram__median__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/ImageHashingTests.hx b/tests/generated/src/tests/ImageHashingTests.hx new file mode 100644 index 00000000..4d537f3a --- /dev/null +++ b/tests/generated/src/tests/ImageHashingTests.hx @@ -0,0 +1,50 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.ImageHashing; +import haxe.Int64; +import vision.ds.Matrix2D; +import vision.tools.ImageTools; +import vision.ds.ByteArray; +import vision.ds.Image; +import vision.ds.ImageResizeAlgorithm; + +class ImageHashingTests { + public static function vision_algorithms_ImageHashing__phash__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.ImageHashing.phash((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.ImageHashing.phash", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_ImageHashing__ahash__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.ImageHashing.ahash((null : Image), (null : Int)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.ImageHashing.ahash", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_ImageHashing__phash__ShouldWork, + vision_algorithms_ImageHashing__ahash__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/ImageIOTests.hx b/tests/generated/src/tests/ImageIOTests.hx new file mode 100644 index 00000000..b9ece22a --- /dev/null +++ b/tests/generated/src/tests/ImageIOTests.hx @@ -0,0 +1,12 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.formats.ImageIO; +import vision.formats.from.From; +import vision.formats.to.To; + +class ImageIOTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/Int16Point2DTests.hx b/tests/generated/src/tests/Int16Point2DTests.hx new file mode 100644 index 00000000..315b780c --- /dev/null +++ b/tests/generated/src/tests/Int16Point2DTests.hx @@ -0,0 +1,119 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Int16Point2D; +import vision.tools.MathTools; + +class Int16Point2DTests { + public static function vision_ds_Int16Point2D__x__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.x; + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#x", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Int16Point2D__y__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.y; + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#y", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Int16Point2D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Int16Point2D__toPoint2D__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.toPoint2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Int16Point2D__toIntPoint2D__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.toIntPoint2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#toIntPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Int16Point2D__toInt__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + result = object.toInt(); + } catch (e) { + + } + + return { + testName: "vision.ds.Int16Point2D#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Int16Point2D__toString__ShouldWork, + vision_ds_Int16Point2D__toPoint2D__ShouldWork, + vision_ds_Int16Point2D__toIntPoint2D__ShouldWork, + vision_ds_Int16Point2D__toInt__ShouldWork, + vision_ds_Int16Point2D__x__ShouldWork, + vision_ds_Int16Point2D__y__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index 59fe2433..ccb07936 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -59,6 +59,40 @@ class IntPoint2DTests { } } + public static function vision_ds_IntPoint2D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_IntPoint2D__toPoint2D__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.toPoint2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { var result = null; try { @@ -110,11 +144,31 @@ class IntPoint2DTests { } } + public static function vision_ds_IntPoint2D__copy__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + result = object.copy(); + } catch (e) { + + } + + return { + testName: "vision.ds.IntPoint2D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } + public static var tests = [ vision_ds_IntPoint2D__fromPoint2D__ShouldWork, + vision_ds_IntPoint2D__toString__ShouldWork, + vision_ds_IntPoint2D__toPoint2D__ShouldWork, vision_ds_IntPoint2D__radiansTo__ShouldWork, vision_ds_IntPoint2D__distanceTo__ShouldWork, vision_ds_IntPoint2D__degreesTo__ShouldWork, + vision_ds_IntPoint2D__copy__ShouldWork, vision_ds_IntPoint2D__x__ShouldWork, vision_ds_IntPoint2D__y__ShouldWork]; } \ No newline at end of file diff --git a/tests/generated/src/tests/KMeansTests.hx b/tests/generated/src/tests/KMeansTests.hx new file mode 100644 index 00000000..b65c1e7e --- /dev/null +++ b/tests/generated/src/tests/KMeansTests.hx @@ -0,0 +1,14 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.KMeans; +import vision.ds.Color; +import vision.ds.Image; +import vision.ds.kmeans.ColorCluster; +import vision.exceptions.Unimplemented; + +class KMeansTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/LaplaceTests.hx b/tests/generated/src/tests/LaplaceTests.hx new file mode 100644 index 00000000..8883be8a --- /dev/null +++ b/tests/generated/src/tests/LaplaceTests.hx @@ -0,0 +1,48 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Laplace; +import vision.ds.gaussian.GaussianKernelSize; +import vision.ds.Color; +import vision.tools.ImageTools; +import vision.ds.Image; + +class LaplaceTests { + public static function vision_algorithms_Laplace__laplacianOfGaussian__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Laplace.laplacianOfGaussian((null : Image), (null : GaussianKernelSize), (null : Float), (null : Float), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Laplace.laplacianOfGaussian", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Laplace__convolveWithLaplacianOperator__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Laplace.convolveWithLaplacianOperator((null : Image), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_Laplace__laplacianOfGaussian__ShouldWork, + vision_algorithms_Laplace__convolveWithLaplacianOperator__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index 74124c9f..aed2c382 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -370,6 +370,22 @@ class MathToolsTests { } } + public static function vision_tools_MathTools__random__ShouldWork():TestResult { + var result = null; + try { + result = vision.tools.MathTools.random(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.random", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { var result = null; try { @@ -1282,6 +1298,7 @@ class MathToolsTests { vision_tools_MathTools__secd__ShouldWork, vision_tools_MathTools__sec__ShouldWork, vision_tools_MathTools__round__ShouldWork, + vision_tools_MathTools__random__ShouldWork, vision_tools_MathTools__radiansToSlope__ShouldWork, vision_tools_MathTools__radiansToDegrees__ShouldWork, vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, diff --git a/tests/generated/src/tests/PerspectiveWarpTests.hx b/tests/generated/src/tests/PerspectiveWarpTests.hx new file mode 100644 index 00000000..b484e2ec --- /dev/null +++ b/tests/generated/src/tests/PerspectiveWarpTests.hx @@ -0,0 +1,29 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.PerspectiveWarp; +import vision.ds.Matrix2D; +import vision.ds.Point2D; + +class PerspectiveWarpTests { + public static function vision_algorithms_PerspectiveWarp__generateMatrix__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.PerspectiveWarp.generateMatrix((null : Array), (null : Array)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.PerspectiveWarp.generateMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_PerspectiveWarp__generateMatrix__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/PerwittTests.hx b/tests/generated/src/tests/PerwittTests.hx new file mode 100644 index 00000000..c3784053 --- /dev/null +++ b/tests/generated/src/tests/PerwittTests.hx @@ -0,0 +1,47 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Perwitt; +import vision.ds.Color; +import vision.tools.ImageTools; +import vision.ds.Image; + +class PerwittTests { + public static function vision_algorithms_Perwitt__detectEdges__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Perwitt.detectEdges((null : Image), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Perwitt.detectEdges", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Perwitt__convolveWithPerwittOperator__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Perwitt.convolveWithPerwittOperator((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_Perwitt__detectEdges__ShouldWork, + vision_algorithms_Perwitt__convolveWithPerwittOperator__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/PixelTests.hx b/tests/generated/src/tests/PixelTests.hx new file mode 100644 index 00000000..e3f165a1 --- /dev/null +++ b/tests/generated/src/tests/PixelTests.hx @@ -0,0 +1,11 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Pixel; + + +class PixelTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx new file mode 100644 index 00000000..da7999a7 --- /dev/null +++ b/tests/generated/src/tests/Point2DTests.hx @@ -0,0 +1,101 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Point2D; +import vision.tools.MathTools; + +class Point2DTests { + public static function vision_ds_Point2D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point2D((null : Float), (null : Float)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point2D__radiansTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point2D((null : Float), (null : Float)); + result = object.radiansTo((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.Point2D#radiansTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point2D__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point2D((null : Float), (null : Float)); + result = object.distanceTo((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.Point2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point2D__degreesTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point2D((null : Float), (null : Float)); + result = object.degreesTo((null : Point2D)); + } catch (e) { + + } + + return { + testName: "vision.ds.Point2D#degreesTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point2D__copy__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point2D((null : Float), (null : Float)); + result = object.copy(); + } catch (e) { + + } + + return { + testName: "vision.ds.Point2D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Point2D__toString__ShouldWork, + vision_ds_Point2D__radiansTo__ShouldWork, + vision_ds_Point2D__distanceTo__ShouldWork, + vision_ds_Point2D__degreesTo__ShouldWork, + vision_ds_Point2D__copy__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx new file mode 100644 index 00000000..5d850fe8 --- /dev/null +++ b/tests/generated/src/tests/Point3DTests.hx @@ -0,0 +1,65 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Point3D; +import vision.tools.MathTools; + +class Point3DTests { + public static function vision_ds_Point3D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Point3D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point3D__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); + result = object.distanceTo((null : Point3D)); + } catch (e) { + + } + + return { + testName: "vision.ds.Point3D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Point3D__copy__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); + result = object.copy(); + } catch (e) { + + } + + return { + testName: "vision.ds.Point3D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Point3D__toString__ShouldWork, + vision_ds_Point3D__distanceTo__ShouldWork, + vision_ds_Point3D__copy__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/PointTransformationPairTests.hx b/tests/generated/src/tests/PointTransformationPairTests.hx new file mode 100644 index 00000000..099b930f --- /dev/null +++ b/tests/generated/src/tests/PointTransformationPairTests.hx @@ -0,0 +1,11 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.specifics.PointTransformationPair; + + +class PointTransformationPairTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/QueueCellTests.hx b/tests/generated/src/tests/QueueCellTests.hx new file mode 100644 index 00000000..00a5733d --- /dev/null +++ b/tests/generated/src/tests/QueueCellTests.hx @@ -0,0 +1,29 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.QueueCell; + + +class QueueCellTests { + public static function vision_ds_QueueCell__getValue__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.QueueCell((null : T), (null : QueueCell), (null : QueueCell)); + result = object.getValue(); + } catch (e) { + + } + + return { + testName: "vision.ds.QueueCell#getValue", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_QueueCell__getValue__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx new file mode 100644 index 00000000..d287629b --- /dev/null +++ b/tests/generated/src/tests/RadixTests.hx @@ -0,0 +1,13 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Radix; +import vision.tools.ArrayTools; +import haxe.extern.EitherType; +import haxe.Int64; + +class RadixTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/RectangleTests.hx b/tests/generated/src/tests/RectangleTests.hx new file mode 100644 index 00000000..700dd463 --- /dev/null +++ b/tests/generated/src/tests/RectangleTests.hx @@ -0,0 +1,11 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Rectangle; + + +class RectangleTests { + public static var tests = []; +} \ No newline at end of file diff --git a/tests/generated/src/tests/RobertsCrossTests.hx b/tests/generated/src/tests/RobertsCrossTests.hx new file mode 100644 index 00000000..15ea0fef --- /dev/null +++ b/tests/generated/src/tests/RobertsCrossTests.hx @@ -0,0 +1,29 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.RobertsCross; +import vision.tools.ImageTools; +import vision.ds.Image; + +class RobertsCrossTests { + public static function vision_algorithms_RobertsCross__convolveWithRobertsCross__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.RobertsCross.convolveWithRobertsCross((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.RobertsCross.convolveWithRobertsCross", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_RobertsCross__convolveWithRobertsCross__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/SimpleHoughTests.hx b/tests/generated/src/tests/SimpleHoughTests.hx new file mode 100644 index 00000000..2cc837b7 --- /dev/null +++ b/tests/generated/src/tests/SimpleHoughTests.hx @@ -0,0 +1,30 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.SimpleHough; +import vision.ds.Color; +import vision.ds.Ray2D; +import vision.ds.Image; + +class SimpleHoughTests { + public static function vision_algorithms_SimpleHough__mapLines__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.SimpleHough.mapLines((null : Image), (null : Array)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.SimpleHough.mapLines", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_SimpleHough__mapLines__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/SimpleLineDetectorTests.hx b/tests/generated/src/tests/SimpleLineDetectorTests.hx new file mode 100644 index 00000000..0ea473a4 --- /dev/null +++ b/tests/generated/src/tests/SimpleLineDetectorTests.hx @@ -0,0 +1,49 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.SimpleLineDetector; +import vision.tools.MathTools; +import vision.ds.Int16Point2D; +import vision.ds.Line2D; +import vision.ds.Image; +import vision.ds.IntPoint2D; + +class SimpleLineDetectorTests { + public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.SimpleLineDetector.lineCoveragePercentage((null : Image), (null : Line2D)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.SimpleLineDetector.lineCoveragePercentage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_SimpleLineDetector__findLineFromPoint__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.SimpleLineDetector.findLineFromPoint((null : Image), (null : Int16Point2D), (null : Float), (null : Bool), (null : Bool)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork, + vision_algorithms_SimpleLineDetector__findLineFromPoint__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/SobelTests.hx b/tests/generated/src/tests/SobelTests.hx new file mode 100644 index 00000000..6d6304fa --- /dev/null +++ b/tests/generated/src/tests/SobelTests.hx @@ -0,0 +1,47 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.algorithms.Sobel; +import vision.ds.Color; +import vision.tools.ImageTools; +import vision.ds.Image; + +class SobelTests { + public static function vision_algorithms_Sobel__detectEdges__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Sobel.detectEdges((null : Image), (null : Float)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Sobel.detectEdges", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Sobel__convolveWithSobelOperator__ShouldWork():TestResult { + var result = null; + try { + result = vision.algorithms.Sobel.convolveWithSobelOperator((null : Image)); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Sobel.convolveWithSobelOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_algorithms_Sobel__detectEdges__ShouldWork, + vision_algorithms_Sobel__convolveWithSobelOperator__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx new file mode 100644 index 00000000..33baf1b6 --- /dev/null +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -0,0 +1,119 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.UInt16Point2D; + + +class UInt16Point2DTests { + public static function vision_ds_UInt16Point2D__x__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.x; + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#x", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_UInt16Point2D__y__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.y; + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#y", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_UInt16Point2D__toString__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_UInt16Point2D__toPoint2D__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.toPoint2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_UInt16Point2D__toIntPoint2D__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.toIntPoint2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#toIntPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_UInt16Point2D__toInt__ShouldWork():TestResult { + var result = null; + try { + var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + result = object.toInt(); + } catch (e) { + + } + + return { + testName: "vision.ds.UInt16Point2D#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_UInt16Point2D__toString__ShouldWork, + vision_ds_UInt16Point2D__toPoint2D__ShouldWork, + vision_ds_UInt16Point2D__toIntPoint2D__ShouldWork, + vision_ds_UInt16Point2D__toInt__ShouldWork, + vision_ds_UInt16Point2D__x__ShouldWork, + vision_ds_UInt16Point2D__y__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generator/Config.hx b/tests/generator/Config.hx new file mode 100644 index 00000000..686601bd --- /dev/null +++ b/tests/generator/Config.hx @@ -0,0 +1,14 @@ +package; + +class Config { + macro public static function load(path:String) { + // Register a dependency to the external file so the Haxe compilation cache is invalidated if the file changes. + haxe.macro.Context.registerModuleDependency(haxe.macro.Context.getLocalModule(), path); + return try { + var json = haxe.Json.parse(sys.io.File.getContent(path)); + macro $v{json}; + } catch (e) { + haxe.macro.Context.error('Failed to load json: $e', haxe.macro.Context.currentPos()); + } + } +} diff --git a/tests/generator/Detector.hx b/tests/generator/Detector.hx index 727b42a8..5a46437b 100644 --- a/tests/generator/Detector.hx +++ b/tests/generator/Detector.hx @@ -6,12 +6,12 @@ import sys.FileSystem; class Detector { static var packageFinder = ~/^package ([\w.]+)/m; - static var importFinder = ~/^import ([\w.]+)/m; + static var importFinder = ~/^import ([\w.*]+)/m; static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; - static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; + static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.*)\)(?::\w+)?\s*(?:$|{)/m; static var staticFieldFinder = ~/(?:public static inline|public inline static|inline public static|public static) (?:var|final) (\w+)\(get, \w+\)/m; static var instanceFieldFinder = ~/(?:public inline|inline public|public) (?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.+)\)(?::\w+)?\s*(?:$|{)/m; + static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.*)\)(?::\w+)?\s*(?:$|{)/m; static var constructorFinder = ~/function new\s*\((.*)\)/; public static function detectOnFile(pathToHaxeFile:String):TestDetections { @@ -29,7 +29,10 @@ class Detector { imports.push(classPath); } - classNameFinder.match(fileContent); + if (!classNameFinder.match(fileContent)) { + return null; + } + var className = classNameFinder.matched(1); fileContent = classNameFinder.matchedRight(); @@ -63,6 +66,10 @@ class Detector { var functionName = instanceFunctionFinder.matched(1); var functionParameters = instanceFunctionFinder.matched(2); fileContent = instanceFunctionFinder.matchedRight(); + + if (functionName == "new") { + continue; + } instanceFunctions.set(functionName, functionParameters); } @@ -78,7 +85,7 @@ class Detector { } fileContent = originalFileContent; - trace(originalFileContent); + var constructorParameters = []; while (constructorFinder.match(fileContent)) { var parameters = constructorFinder.matched(1); diff --git a/tests/generator/Generator.hx b/tests/generator/Generator.hx index c21038ec..0430eaa8 100644 --- a/tests/generator/Generator.hx +++ b/tests/generator/Generator.hx @@ -19,14 +19,16 @@ class Generator { public static var testClassActuatorTemplate = File.getContent(FileSystem.absolutePath("generator/templates/TestClassActuator.hx")); public static var testClassHeaderTemplate = File.getContent(FileSystem.absolutePath("generator/templates/TestClassHeader.hx")); - public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String) { + public static function generateFromFile(pathToHaxeFile:String, pathToOutputFile:String):Bool { var detections = Detector.detectOnFile(pathToHaxeFile); + if (detections == null) { + Sys.println('INFO: No tests could be generated for $pathToHaxeFile'); + return false; + } var file = File.write(FileSystem.absolutePath(pathToOutputFile)); file.writeString(generateFileHeader(detections.packageName, detections.className, detections.imports)); - trace(detections); - for (field in detections.staticFields) { file.writeString(generateTest(staticFieldTemplate, { packageName: detections.packageName, @@ -42,7 +44,7 @@ class Generator { className: detections.className, fieldName: field, testGoal: "ShouldWork", - constructorParameters: extractParameters(detections.constructorParameters[0]) + constructorParameters: extractParameters(detections.constructorParameters[0] ?? "") })); } @@ -63,7 +65,7 @@ class Generator { fieldName: method, testGoal: "ShouldWork", parameters: extractParameters(parameters), - constructorParameters: extractParameters(detections.constructorParameters[0]) + constructorParameters: extractParameters(detections.constructorParameters[0] ?? "") })); } @@ -72,6 +74,8 @@ class Generator { file.writeString(generateFileFooter()); file.close(); + + return true; } static function generateFileHeader(packageName:String, className:String, imports:Array):String { @@ -122,7 +126,7 @@ class Generator { static function extractParameters(parameters:String):String { - var regex = ~/\w+:(\w+|\{.+\},?)/; + var regex = ~/\w+:((?:\w|\.)+|\{.+\},?)/; var parameterList = []; while (regex.match(parameters)) { var type = regex.matched(1); diff --git a/tests/generator/Main.hx b/tests/generator/Main.hx index db3b7290..ee977f64 100644 --- a/tests/generator/Main.hx +++ b/tests/generator/Main.hx @@ -1,8 +1,71 @@ package; +import vision.ds.IntPoint2D; +import sys.io.File; +import sys.FileSystem; + +using StringTools; + class Main { + static function main() { - Generator.generateFromFile("../src/vision/tools/MathTools.hx", "generated/src/tests/MathToolsTests.hx"); - Generator.generateFromFile("../src/vision/ds/IntPoint2D.hx", "generated/src/tests/IntPoint2DTests.hx"); + var config = Config.load("config.json"); + var files = []; + if (config.regenerateAll) { + files = readFileStructure(FileSystem.absolutePath(config.source)); + } + + var source = FileSystem.absolutePath(config.source); + var destination = FileSystem.absolutePath(config.destination); + + var resultingClassArray = []; + + for (file in files) { + if (file.endsWith(".js.hx")) { + Sys.println('Skipping: $file: $file is a js interface file'); + continue; + } + var shouldSkip = false; + for (exclude in config.exclude) { + trace(file, exclude); + if (file.contains(exclude)) { + Sys.println('Skipping: $file: $file contains `$exclude`'); + shouldSkip = true; + break; + } + } + if (shouldSkip) { + continue; + } + + var outputFile = destination + "/" + file.split("/").pop().replace(".hx", "Tests.hx"); + if (!config.overwrite && FileSystem.exists(outputFile)) { + Sys.println('Skipping: $file: $outputFile already exists'); + } else { + Sys.println('Generating: $file -> $outputFile'); + if (!Generator.generateFromFile(file, outputFile)) { + continue; + } + } + + resultingClassArray.push(outputFile.split("/").pop().replace(".hx", "")); + } + + Sys.println("Job Done! Use this array to test the classes:"); + Sys.println(' [${resultingClassArray.join(", ")}]'); + } + + static function readFileStructure(from:String):Array { + var files = FileSystem.readDirectory(from); + var result = []; + for (file in files) { + var path = from + "/" + file; + if (FileSystem.isDirectory(path)) { + result = result.concat(readFileStructure(path)); + } else { + result.push(path); + } + } + return result; } } \ No newline at end of file From e19d173eabb75b57ff00033777fa71a47144e183 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Thu, 5 Jun 2025 12:06:50 +0300 Subject: [PATCH 20/32] A more intelligent generator, also a more comfortable gen + run method via seperate hxml file. todo - handle void functions, better handling for type params (even stupid handling is ok), also target-dependent functions maybe? (detect imports and if theyre not from vision dont generate tests) --- tests/complete.hxml | 19 + tests/config.json | 14 +- tests/generated/src/Main.hx | 4 +- tests/generated/src/TestsToRun.hx | 43 + tests/generated/src/tests/Array2DTests.hx | 119 --- tests/generated/src/tests/ArrayToolsTests.hx | 35 + .../src/tests/BilateralFilterTests.hx | 7 +- .../src/tests/BilinearInterpolationTests.hx | 15 +- tests/generated/src/tests/ByteArrayTests.hx | 230 ----- tests/generated/src/tests/CannyObjectTests.hx | 1 + tests/generated/src/tests/CannyTests.hx | 25 +- .../generated/src/tests/ColorClusterTests.hx | 1 + tests/generated/src/tests/ColorTests.hx | 313 ++++-- tests/generated/src/tests/CramerTests.hx | 1 + .../src/tests/FormatImageExporterTests.hx | 13 +- .../src/tests/FormatImageLoaderTests.hx | 9 +- tests/generated/src/tests/GaussJordanTests.hx | 5 +- tests/generated/src/tests/GaussTests.hx | 12 +- tests/generated/src/tests/HistogramTests.hx | 13 +- .../generated/src/tests/ImageHashingTests.hx | 10 +- tests/generated/src/tests/ImageIOTests.hx | 1 + .../generated/src/tests/Int16Point2DTests.hx | 35 +- tests/generated/src/tests/IntPoint2DTests.hx | 60 +- tests/generated/src/tests/KMeansTests.hx | 1 + tests/generated/src/tests/LaplaceTests.hx | 14 +- tests/generated/src/tests/Line2DTests.hx | 163 +++ tests/generated/src/tests/MathToolsTests.hx | 326 ++++-- .../src/tests/PerspectiveWarpTests.hx | 6 +- tests/generated/src/tests/PerwittTests.hx | 10 +- tests/generated/src/tests/PixelTests.hx | 1 + tests/generated/src/tests/Point2DTests.hx | 40 +- tests/generated/src/tests/Point3DTests.hx | 25 +- .../src/tests/PointTransformationPairTests.hx | 1 + tests/generated/src/tests/QueueCellTests.hx | 29 - tests/generated/src/tests/QueueTests.hx | 113 ++ tests/generated/src/tests/RadixTests.hx | 1 + tests/generated/src/tests/Ray2DTests.hx | 178 ++++ tests/generated/src/tests/RectangleTests.hx | 1 + .../generated/src/tests/RobertsCrossTests.hx | 5 +- tests/generated/src/tests/SimpleHoughTests.hx | 6 +- .../src/tests/SimpleLineDetectorTests.hx | 14 +- tests/generated/src/tests/SobelTests.hx | 10 +- .../generated/src/tests/UInt16Point2DTests.hx | 35 +- tests/generated/src/tests/VisionTests.hx | 965 ++++++++++++++++++ tests/generator/Generator.hx | 55 +- tests/generator/Main.hx | 4 + .../templates/InstanceFieldTestTemplate.hx | 1 + .../templates/InstanceFunctionTestTemplate.hx | 2 + .../templates/StaticFunctionTestTemplate.hx | 1 + tests/generator/templates/TestClassHeader.hx | 1 + tests/generator/templates/doc.hx | 2 + 51 files changed, 2387 insertions(+), 608 deletions(-) create mode 100644 tests/complete.hxml create mode 100644 tests/generated/src/TestsToRun.hx delete mode 100644 tests/generated/src/tests/Array2DTests.hx create mode 100644 tests/generated/src/tests/ArrayToolsTests.hx delete mode 100644 tests/generated/src/tests/ByteArrayTests.hx create mode 100644 tests/generated/src/tests/Line2DTests.hx delete mode 100644 tests/generated/src/tests/QueueCellTests.hx create mode 100644 tests/generated/src/tests/QueueTests.hx create mode 100644 tests/generated/src/tests/Ray2DTests.hx create mode 100644 tests/generated/src/tests/VisionTests.hx diff --git a/tests/complete.hxml b/tests/complete.hxml new file mode 100644 index 00000000..6992a4ab --- /dev/null +++ b/tests/complete.hxml @@ -0,0 +1,19 @@ +--class-path generator +--main Main + +--library vision + +--define --regenerate-all +--define --no-overwrite + +--interp + +--next + +--cwd generated +--class-path src +--main Main +--library vision +--library format + +--interp \ No newline at end of file diff --git a/tests/config.json b/tests/config.json index 328c1829..cb4114e5 100644 --- a/tests/config.json +++ b/tests/config.json @@ -4,25 +4,17 @@ "source": "../src/vision", "exclude": [ "exceptions/", - "TransformationMatrix2D.hx", "VisionThread.hx", - "Vision.hx", - "Ray2D.hx", - "Queue.hx", "Matrix2D.hx", - "Line2D.hx", "ImageView.hx", "Image.hx", "ImageTools.hx", - "ArrayTools.hx", "Array2DMacro.hx", "FrameworkImageIO.hx", - "Color.hx", "ByteArray.hx", "QueueCell.hx", - "Array2D.hx", - "PerspectiveWarp.hx", - "SimpleHough.hx" + "Array2D.hx" ], - "destination": "./generated/src/tests" + "destination": "./generated/src/tests", + "testsToRunFile": "./generated/src/TestsToRun.hx" } \ No newline at end of file diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 8c84b87d..f1eaae96 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -6,9 +6,9 @@ import tests.*; import TestStatus; import TestResult; import TestConclusion; +import TestsToRun; class Main { - public static var testedClasses:Array> = [BilateralFilterTests, BilinearInterpolationTests, CannyTests, CramerTests, GaussTests, GaussJordanTests, ImageHashingTests, KMeansTests, LaplaceTests, PerwittTests, RadixTests, RobertsCrossTests, SimpleLineDetectorTests, SobelTests, CannyObjectTests, HistogramTests, Int16Point2DTests, IntPoint2DTests, ColorClusterTests, PixelTests, Point2DTests, Point3DTests, RectangleTests, PointTransformationPairTests, UInt16Point2DTests, ImageIOTests, FormatImageExporterTests, FormatImageLoaderTests, MathToolsTests]; // ANSI colors static var RED = "\033[31m"; @@ -37,7 +37,7 @@ class Main { conclusionMap.set(statusType, []); } - for (cls in testedClasses) { + for (cls in TestsToRun.tests) { var testFunctions:Array<() -> TestResult> = Reflect.field(cls, "tests"); for (func in testFunctions) { i++; diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx new file mode 100644 index 00000000..43d71c88 --- /dev/null +++ b/tests/generated/src/TestsToRun.hx @@ -0,0 +1,43 @@ +package; + +import tests.*; + +final tests:Array> = [ + BilateralFilterTests, + BilinearInterpolationTests, + CannyTests, + CramerTests, + GaussTests, + GaussJordanTests, + ImageHashingTests, + KMeansTests, + LaplaceTests, + PerspectiveWarpTests, + PerwittTests, + RadixTests, + RobertsCrossTests, + SimpleHoughTests, + SimpleLineDetectorTests, + SobelTests, + CannyObjectTests, + ColorTests, + HistogramTests, + Int16Point2DTests, + IntPoint2DTests, + ColorClusterTests, + Line2DTests, + PixelTests, + Point2DTests, + Point3DTests, + QueueTests, + Ray2DTests, + RectangleTests, + PointTransformationPairTests, + UInt16Point2DTests, + ImageIOTests, + FormatImageExporterTests, + FormatImageLoaderTests, + ArrayToolsTests, + MathToolsTests, + VisionTests +]; \ No newline at end of file diff --git a/tests/generated/src/tests/Array2DTests.hx b/tests/generated/src/tests/Array2DTests.hx deleted file mode 100644 index 50121aa8..00000000 --- a/tests/generated/src/tests/Array2DTests.hx +++ /dev/null @@ -1,119 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.Array2D; - - -class Array2DTests { - public static function vision_ds_Array2D__length__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.length; - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#length", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Array2D__toString__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.toString(); - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#toString", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Array2D__setMultiple__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.setMultiple((null : Array), (null : T)); - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#setMultiple", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Array2D__set__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.set((null : Int), (null : Int), (null : T)); - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#set", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Array2D__iterator__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.iterator(); - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#iterator", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Array2D__get__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.Array2D((null : Int), (null : Int), (null : T)); - result = object.get((null : Int), (null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#get", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static var tests = [ - vision_ds_Array2D__toString__ShouldWork, - vision_ds_Array2D__setMultiple__ShouldWork, - vision_ds_Array2D__set__ShouldWork, - vision_ds_Array2D__iterator__ShouldWork, - vision_ds_Array2D__get__ShouldWork, - vision_ds_Array2D__length__ShouldWork]; -} \ No newline at end of file diff --git a/tests/generated/src/tests/ArrayToolsTests.hx b/tests/generated/src/tests/ArrayToolsTests.hx new file mode 100644 index 00000000..6ba942f2 --- /dev/null +++ b/tests/generated/src/tests/ArrayToolsTests.hx @@ -0,0 +1,35 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.tools.ArrayTools; +import haxe.Int64; +import haxe.extern.EitherType; +import haxe.ds.ArraySort; +import vision.algorithms.Radix; +import vision.tools.MathTools.*; + +@:access(vision.tools.ArrayTools) +class ArrayToolsTests { + public static function vision_tools_ArrayTools__median__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.median(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_tools_ArrayTools__median__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/BilateralFilterTests.hx b/tests/generated/src/tests/BilateralFilterTests.hx index a449696f..7330e4e2 100644 --- a/tests/generated/src/tests/BilateralFilterTests.hx +++ b/tests/generated/src/tests/BilateralFilterTests.hx @@ -9,11 +9,16 @@ import vision.ds.Color; import vision.ds.Array2D; import vision.ds.Image; +@:access(vision.algorithms.BilateralFilter) class BilateralFilterTests { public static function vision_algorithms_BilateralFilter__filter__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.BilateralFilter.filter((null : Image), (null : Float), (null : Float)); + var image = new vision.ds.Image(100, 100); + var distanceSigma = 0.0; + var intensitySigma = 0.0; + + result = vision.algorithms.BilateralFilter.filter(image, distanceSigma, intensitySigma); } catch (e) { } diff --git a/tests/generated/src/tests/BilinearInterpolationTests.hx b/tests/generated/src/tests/BilinearInterpolationTests.hx index accc07b5..c2ba5dce 100644 --- a/tests/generated/src/tests/BilinearInterpolationTests.hx +++ b/tests/generated/src/tests/BilinearInterpolationTests.hx @@ -10,11 +10,18 @@ import vision.exceptions.OutOfBounds; import vision.ds.Image; import vision.tools.MathTools.*; +@:access(vision.algorithms.BilinearInterpolation) class BilinearInterpolationTests { public static function vision_algorithms_BilinearInterpolation__interpolateMissingPixels__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels((null : Image), (null : Int), (null : Int), (null : Int), (null : Int)); + var image = new vision.ds.Image(100, 100); + var kernelRadiusX = 0; + var kernelRadiusY = 0; + var minX = 0; + var minY = 0; + + result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels(image, kernelRadiusX, kernelRadiusY, minX, minY); } catch (e) { } @@ -30,7 +37,11 @@ class BilinearInterpolationTests { public static function vision_algorithms_BilinearInterpolation__interpolate__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.BilinearInterpolation.interpolate((null : Image), (null : Int), (null : Int)); + var image = new vision.ds.Image(100, 100); + var width = 0; + var height = 0; + + result = vision.algorithms.BilinearInterpolation.interpolate(image, width, height); } catch (e) { } diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx deleted file mode 100644 index e5f1dcd2..00000000 --- a/tests/generated/src/tests/ByteArrayTests.hx +++ /dev/null @@ -1,230 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.ByteArray; -import haxe.Int64; -import vision.tools.MathTools; -import haxe.Serializer; -import haxe.io.BytesData; -import haxe.io.Bytes; - -class ByteArrayTests { - public static function vision_ds_ByteArray__from__ShouldWork():TestResult { - var result = null; - try { - result = vision.ds.ByteArray.from((null : Dynamic)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__setUInt8__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.setUInt8((null : Int), (null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#setUInt8", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__setUInt32__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.setUInt32((null : Int), (null : UInt)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#setUInt32", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__setInt8__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.setInt8((null : Int), (null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#setInt8", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__setBytes__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.setBytes((null : Int), (null : ByteArray)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#setBytes", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__resize__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.resize((null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#resize", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__isEmpty__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.isEmpty(); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#isEmpty", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__getUInt8__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.getUInt8((null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#getUInt8", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__getUInt32__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.getUInt32((null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#getUInt32", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__getInt8__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.getInt8((null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#getInt8", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__getBytes__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.getBytes((null : Int), (null : Int)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#getBytes", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_ByteArray__concat__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.ByteArray((null : Int), (null : Int)); - result = object.concat((null : ByteArray)); - } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray#concat", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static var tests = [ - vision_ds_ByteArray__from__ShouldWork, - vision_ds_ByteArray__setUInt8__ShouldWork, - vision_ds_ByteArray__setUInt32__ShouldWork, - vision_ds_ByteArray__setInt8__ShouldWork, - vision_ds_ByteArray__setBytes__ShouldWork, - vision_ds_ByteArray__resize__ShouldWork, - vision_ds_ByteArray__isEmpty__ShouldWork, - vision_ds_ByteArray__getUInt8__ShouldWork, - vision_ds_ByteArray__getUInt32__ShouldWork, - vision_ds_ByteArray__getInt8__ShouldWork, - vision_ds_ByteArray__getBytes__ShouldWork, - vision_ds_ByteArray__concat__ShouldWork]; -} \ No newline at end of file diff --git a/tests/generated/src/tests/CannyObjectTests.hx b/tests/generated/src/tests/CannyObjectTests.hx index ceb24f0f..58b6d53d 100644 --- a/tests/generated/src/tests/CannyObjectTests.hx +++ b/tests/generated/src/tests/CannyObjectTests.hx @@ -6,6 +6,7 @@ import TestStatus; import vision.ds.canny.CannyObject; +@:access(vision.ds.canny.CannyObject) class CannyObjectTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/CannyTests.hx b/tests/generated/src/tests/CannyTests.hx index 396e8282..685c2ece 100644 --- a/tests/generated/src/tests/CannyTests.hx +++ b/tests/generated/src/tests/CannyTests.hx @@ -8,11 +8,14 @@ import vision.ds.Color; import vision.ds.Image; import vision.ds.canny.CannyObject; +@:access(vision.algorithms.Canny) class CannyTests { public static function vision_algorithms_Canny__nonMaxSuppression__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Canny.nonMaxSuppression((null : CannyObject)); + var image:CannyObject = null; + + result = vision.algorithms.Canny.nonMaxSuppression(image); } catch (e) { } @@ -28,7 +31,9 @@ class CannyTests { public static function vision_algorithms_Canny__grayscale__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Canny.grayscale((null : CannyObject)); + var image:CannyObject = null; + + result = vision.algorithms.Canny.grayscale(image); } catch (e) { } @@ -44,7 +49,9 @@ class CannyTests { public static function vision_algorithms_Canny__applySobelFilters__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Canny.applySobelFilters((null : CannyObject)); + var image:CannyObject = null; + + result = vision.algorithms.Canny.applySobelFilters(image); } catch (e) { } @@ -60,7 +67,11 @@ class CannyTests { public static function vision_algorithms_Canny__applyHysteresis__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Canny.applyHysteresis((null : CannyObject), (null : Float), (null : Float)); + var image:CannyObject = null; + var highThreshold = 0.0; + var lowThreshold = 0.0; + + result = vision.algorithms.Canny.applyHysteresis(image, highThreshold, lowThreshold); } catch (e) { } @@ -76,7 +87,11 @@ class CannyTests { public static function vision_algorithms_Canny__applyGaussian__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Canny.applyGaussian((null : CannyObject), (null : Int), (null : Float)); + var image:CannyObject = null; + var size = 0; + var sigma = 0.0; + + result = vision.algorithms.Canny.applyGaussian(image, size, sigma); } catch (e) { } diff --git a/tests/generated/src/tests/ColorClusterTests.hx b/tests/generated/src/tests/ColorClusterTests.hx index ae1d4c81..dad1b073 100644 --- a/tests/generated/src/tests/ColorClusterTests.hx +++ b/tests/generated/src/tests/ColorClusterTests.hx @@ -6,6 +6,7 @@ import TestStatus; import vision.ds.kmeans.ColorCluster; +@:access(vision.ds.kmeans.ColorCluster) class ColorClusterTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index 347d0743..7241a77d 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -7,11 +7,14 @@ import vision.ds.Color; import vision.tools.ArrayTools; import vision.tools.MathTools; +@:access(vision.ds.Color) class ColorTests { public static function vision_ds_Color__red__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.red; } catch (e) { @@ -28,7 +31,9 @@ class ColorTests { public static function vision_ds_Color__blue__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.blue; } catch (e) { @@ -45,7 +50,9 @@ class ColorTests { public static function vision_ds_Color__green__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.green; } catch (e) { @@ -62,7 +69,9 @@ class ColorTests { public static function vision_ds_Color__alpha__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.alpha; } catch (e) { @@ -79,7 +88,9 @@ class ColorTests { public static function vision_ds_Color__redFloat__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.redFloat; } catch (e) { @@ -96,7 +107,9 @@ class ColorTests { public static function vision_ds_Color__blueFloat__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.blueFloat; } catch (e) { @@ -113,7 +126,9 @@ class ColorTests { public static function vision_ds_Color__greenFloat__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.greenFloat; } catch (e) { @@ -130,7 +145,9 @@ class ColorTests { public static function vision_ds_Color__alphaFloat__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.alphaFloat; } catch (e) { @@ -147,7 +164,9 @@ class ColorTests { public static function vision_ds_Color__cyan__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.cyan; } catch (e) { @@ -164,7 +183,9 @@ class ColorTests { public static function vision_ds_Color__magenta__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.magenta; } catch (e) { @@ -181,7 +202,9 @@ class ColorTests { public static function vision_ds_Color__yellow__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.yellow; } catch (e) { @@ -198,7 +221,9 @@ class ColorTests { public static function vision_ds_Color__black__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.black; } catch (e) { @@ -215,7 +240,9 @@ class ColorTests { public static function vision_ds_Color__rgb__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.rgb; } catch (e) { @@ -232,7 +259,9 @@ class ColorTests { public static function vision_ds_Color__hue__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.hue; } catch (e) { @@ -249,7 +278,9 @@ class ColorTests { public static function vision_ds_Color__saturation__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.saturation; } catch (e) { @@ -266,7 +297,9 @@ class ColorTests { public static function vision_ds_Color__brightness__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.brightness; } catch (e) { @@ -283,7 +316,9 @@ class ColorTests { public static function vision_ds_Color__lightness__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + var object = new vision.ds.Color(value); result = object.lightness; } catch (e) { @@ -300,7 +335,10 @@ class ColorTests { public static function vision_ds_Color__subtract__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.subtract((null : Color), (null : Color)); + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.subtract(lhs, rhs); } catch (e) { } @@ -316,7 +354,10 @@ class ColorTests { public static function vision_ds_Color__multiply__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.multiply((null : Color), (null : Color)); + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.multiply(lhs, rhs); } catch (e) { } @@ -332,7 +373,10 @@ class ColorTests { public static function vision_ds_Color__makeRandom__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.makeRandom((null : Bool), (null : Int)); + var alphaLock = false; + var alphaValue = 0; + + result = vision.ds.Color.makeRandom(alphaLock, alphaValue); } catch (e) { } @@ -348,7 +392,11 @@ class ColorTests { public static function vision_ds_Color__interpolate__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.interpolate((null : Color), (null : Color), (null : Float)); + var Color1:Color = null; + var Color2:Color = null; + var Factor = 0.0; + + result = vision.ds.Color.interpolate(Color1, Color2, Factor); } catch (e) { } @@ -364,7 +412,10 @@ class ColorTests { public static function vision_ds_Color__getAverage__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.getAverage((null : Array), (null : Bool)); + var fromColors = []; + var considerTransparency = false; + + result = vision.ds.Color.getAverage(fromColors, considerTransparency); } catch (e) { } @@ -380,7 +431,12 @@ class ColorTests { public static function vision_ds_Color__fromRGBAFloat__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromRGBAFloat((null : Float), (null : Float), (null : Float), (null : Float)); + var Red = 0.0; + var Green = 0.0; + var Blue = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); } catch (e) { } @@ -396,7 +452,12 @@ class ColorTests { public static function vision_ds_Color__fromRGBA__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromRGBA((null : Int), (null : Int), (null : Int), (null : Int)); + var Red = 0; + var Green = 0; + var Blue = 0; + var Alpha = 0; + + result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); } catch (e) { } @@ -412,7 +473,9 @@ class ColorTests { public static function vision_ds_Color__fromInt__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromInt((null : Int)); + var value = 0; + + result = vision.ds.Color.fromInt(value); } catch (e) { } @@ -428,7 +491,12 @@ class ColorTests { public static function vision_ds_Color__fromHSL__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromHSL((null : Float), (null : Float), (null : Float), (null : Float)); + var Hue = 0.0; + var Saturation = 0.0; + var Lightness = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); } catch (e) { } @@ -444,7 +512,12 @@ class ColorTests { public static function vision_ds_Color__fromHSB__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromHSB((null : Float), (null : Float), (null : Float), (null : Float)); + var Hue = 0.0; + var Saturation = 0.0; + var Brightness = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); } catch (e) { } @@ -460,7 +533,9 @@ class ColorTests { public static function vision_ds_Color__fromFloat__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromFloat((null : Float)); + var Value = 0.0; + + result = vision.ds.Color.fromFloat(Value); } catch (e) { } @@ -476,7 +551,13 @@ class ColorTests { public static function vision_ds_Color__fromCMYK__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.fromCMYK((null : Float), (null : Float), (null : Float), (null : Float), (null : Float)); + var Cyan = 0.0; + var Magenta = 0.0; + var Yellow = 0.0; + var Black = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); } catch (e) { } @@ -492,7 +573,9 @@ class ColorTests { public static function vision_ds_Color__from8Bit__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.from8Bit((null : Int)); + var Value = 0; + + result = vision.ds.Color.from8Bit(Value); } catch (e) { } @@ -508,7 +591,10 @@ class ColorTests { public static function vision_ds_Color__divide__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.divide((null : Color), (null : Color)); + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.divide(lhs, rhs); } catch (e) { } @@ -524,7 +610,11 @@ class ColorTests { public static function vision_ds_Color__distanceBetween__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.distanceBetween((null : Color), (null : Color), (null : Bool)); + var lhs:Color = null; + var rhs:Color = null; + var considerTransparency = false; + + result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); } catch (e) { } @@ -540,7 +630,11 @@ class ColorTests { public static function vision_ds_Color__differenceBetween__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.differenceBetween((null : Color), (null : Color), (null : Bool)); + var lhs:Color = null; + var rhs:Color = null; + var considerTransparency = false; + + result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); } catch (e) { } @@ -556,7 +650,10 @@ class ColorTests { public static function vision_ds_Color__add__ShouldWork():TestResult { var result = null; try { - result = vision.ds.Color.add((null : Color), (null : Color)); + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.add(lhs, rhs); } catch (e) { } @@ -572,7 +669,10 @@ class ColorTests { public static function vision_ds_Color__toWebString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.toWebString(); } catch (e) { @@ -589,7 +689,10 @@ class ColorTests { public static function vision_ds_Color__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.toString(); } catch (e) { @@ -606,7 +709,10 @@ class ColorTests { public static function vision_ds_Color__toInt__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.toInt(); } catch (e) { @@ -623,8 +729,13 @@ class ColorTests { public static function vision_ds_Color__toHexString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.toHexString((null : Bool), (null : Bool)); + var value = 0; + + var Alpha = false; + var Prefix = false; + + var object = new vision.ds.Color(value); + result = object.toHexString(Alpha, Prefix); } catch (e) { } @@ -640,7 +751,10 @@ class ColorTests { public static function vision_ds_Color__to24Bit__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.to24Bit(); } catch (e) { @@ -657,8 +771,15 @@ class ColorTests { public static function vision_ds_Color__setRGBAFloat__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.setRGBAFloat((null : Float), (null : Float), (null : Float), (null : Float)); + var value = 0; + + var Red = 0.0; + var Green = 0.0; + var Blue = 0.0; + var Alpha = 0.0; + + var object = new vision.ds.Color(value); + result = object.setRGBAFloat(Red, Green, Blue, Alpha); } catch (e) { } @@ -674,8 +795,15 @@ class ColorTests { public static function vision_ds_Color__setRGBA__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.setRGBA((null : Int), (null : Int), (null : Int), (null : Int)); + var value = 0; + + var Red = 0; + var Green = 0; + var Blue = 0; + var Alpha = 0; + + var object = new vision.ds.Color(value); + result = object.setRGBA(Red, Green, Blue, Alpha); } catch (e) { } @@ -691,8 +819,15 @@ class ColorTests { public static function vision_ds_Color__setHSL__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.setHSL((null : Float), (null : Float), (null : Float), (null : Float)); + var value = 0; + + var Hue = 0.0; + var Saturation = 0.0; + var Lightness = 0.0; + var Alpha = 0.0; + + var object = new vision.ds.Color(value); + result = object.setHSL(Hue, Saturation, Lightness, Alpha); } catch (e) { } @@ -708,8 +843,15 @@ class ColorTests { public static function vision_ds_Color__setHSB__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.setHSB((null : Float), (null : Float), (null : Float), (null : Float)); + var value = 0; + + var Hue = 0.0; + var Saturation = 0.0; + var Brightness = 0.0; + var Alpha = 0.0; + + var object = new vision.ds.Color(value); + result = object.setHSB(Hue, Saturation, Brightness, Alpha); } catch (e) { } @@ -725,8 +867,16 @@ class ColorTests { public static function vision_ds_Color__setCMYK__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.setCMYK((null : Float), (null : Float), (null : Float), (null : Float), (null : Float)); + var value = 0; + + var Cyan = 0.0; + var Magenta = 0.0; + var Yellow = 0.0; + var Black = 0.0; + var Alpha = 0.0; + + var object = new vision.ds.Color(value); + result = object.setCMYK(Cyan, Magenta, Yellow, Black, Alpha); } catch (e) { } @@ -742,8 +892,12 @@ class ColorTests { public static function vision_ds_Color__lighten__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.lighten((null : Float)); + var value = 0; + + var Factor = 0.0; + + var object = new vision.ds.Color(value); + result = object.lighten(Factor); } catch (e) { } @@ -759,7 +913,10 @@ class ColorTests { public static function vision_ds_Color__invert__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.invert(); } catch (e) { @@ -776,8 +933,12 @@ class ColorTests { public static function vision_ds_Color__grayscale__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.grayscale((null : Bool)); + var value = 0; + + var simple = false; + + var object = new vision.ds.Color(value); + result = object.grayscale(simple); } catch (e) { } @@ -793,7 +954,10 @@ class ColorTests { public static function vision_ds_Color__getTriadicHarmony__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.getTriadicHarmony(); } catch (e) { @@ -810,8 +974,12 @@ class ColorTests { public static function vision_ds_Color__getSplitComplementHarmony__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.getSplitComplementHarmony((null : Int)); + var value = 0; + + var Threshold = 0; + + var object = new vision.ds.Color(value); + result = object.getSplitComplementHarmony(Threshold); } catch (e) { } @@ -827,7 +995,10 @@ class ColorTests { public static function vision_ds_Color__getComplementHarmony__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); + var value = 0; + + + var object = new vision.ds.Color(value); result = object.getComplementHarmony(); } catch (e) { @@ -844,8 +1015,12 @@ class ColorTests { public static function vision_ds_Color__getAnalogousHarmony__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.getAnalogousHarmony((null : Int)); + var value = 0; + + var Threshold = 0; + + var object = new vision.ds.Color(value); + result = object.getAnalogousHarmony(Threshold); } catch (e) { } @@ -861,8 +1036,12 @@ class ColorTests { public static function vision_ds_Color__darken__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.darken((null : Float)); + var value = 0; + + var Factor = 0.0; + + var object = new vision.ds.Color(value); + result = object.darken(Factor); } catch (e) { } @@ -878,8 +1057,12 @@ class ColorTests { public static function vision_ds_Color__blackOrWhite__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Color((null : Int)); - result = object.blackOrWhite((null : Int)); + var value = 0; + + var threshold = 0; + + var object = new vision.ds.Color(value); + result = object.blackOrWhite(threshold); } catch (e) { } diff --git a/tests/generated/src/tests/CramerTests.hx b/tests/generated/src/tests/CramerTests.hx index d4dfd178..b122460b 100644 --- a/tests/generated/src/tests/CramerTests.hx +++ b/tests/generated/src/tests/CramerTests.hx @@ -11,6 +11,7 @@ import vision.ds.Matrix2D; import haxe.ds.Vector; import vision.ds.Array2D; +@:access(vision.algorithms.Cramer) class CramerTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageExporterTests.hx b/tests/generated/src/tests/FormatImageExporterTests.hx index 4f7d0d79..370dc426 100644 --- a/tests/generated/src/tests/FormatImageExporterTests.hx +++ b/tests/generated/src/tests/FormatImageExporterTests.hx @@ -17,11 +17,14 @@ import format.bmp.Tools; import format.jpg.Writer; import format.jpg.Data; +@:access(vision.formats.__internal.FormatImageExporter) class FormatImageExporterTests { public static function vision_formats___internal_FormatImageExporter__png__ShouldWork():TestResult { var result = null; try { - result = vision.formats.__internal.FormatImageExporter.png((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.formats.__internal.FormatImageExporter.png(image); } catch (e) { } @@ -37,7 +40,9 @@ class FormatImageExporterTests { public static function vision_formats___internal_FormatImageExporter__jpeg__ShouldWork():TestResult { var result = null; try { - result = vision.formats.__internal.FormatImageExporter.jpeg((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.formats.__internal.FormatImageExporter.jpeg(image); } catch (e) { } @@ -53,7 +58,9 @@ class FormatImageExporterTests { public static function vision_formats___internal_FormatImageExporter__bmp__ShouldWork():TestResult { var result = null; try { - result = vision.formats.__internal.FormatImageExporter.bmp((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.formats.__internal.FormatImageExporter.bmp(image); } catch (e) { } diff --git a/tests/generated/src/tests/FormatImageLoaderTests.hx b/tests/generated/src/tests/FormatImageLoaderTests.hx index 12cfd37f..7dd0fdb9 100644 --- a/tests/generated/src/tests/FormatImageLoaderTests.hx +++ b/tests/generated/src/tests/FormatImageLoaderTests.hx @@ -13,11 +13,14 @@ import format.png.Tools; import format.bmp.Reader; import format.bmp.Tools; +@:access(vision.formats.__internal.FormatImageLoader) class FormatImageLoaderTests { public static function vision_formats___internal_FormatImageLoader__png__ShouldWork():TestResult { var result = null; try { - result = vision.formats.__internal.FormatImageLoader.png((null : ByteArray)); + var bytes = vision.ds.ByteArray.from(0); + + result = vision.formats.__internal.FormatImageLoader.png(bytes); } catch (e) { } @@ -33,7 +36,9 @@ class FormatImageLoaderTests { public static function vision_formats___internal_FormatImageLoader__bmp__ShouldWork():TestResult { var result = null; try { - result = vision.formats.__internal.FormatImageLoader.bmp((null : ByteArray)); + var bytes = vision.ds.ByteArray.from(0); + + result = vision.formats.__internal.FormatImageLoader.bmp(bytes); } catch (e) { } diff --git a/tests/generated/src/tests/GaussJordanTests.hx b/tests/generated/src/tests/GaussJordanTests.hx index 78bf9b94..0ca95682 100644 --- a/tests/generated/src/tests/GaussJordanTests.hx +++ b/tests/generated/src/tests/GaussJordanTests.hx @@ -6,11 +6,14 @@ import TestStatus; import vision.algorithms.GaussJordan; import vision.ds.Matrix2D; +@:access(vision.algorithms.GaussJordan) class GaussJordanTests { public static function vision_algorithms_GaussJordan__invert__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.GaussJordan.invert((null : Matrix2D)); + var matrix:Matrix2D = null; + + result = vision.algorithms.GaussJordan.invert(matrix); } catch (e) { } diff --git a/tests/generated/src/tests/GaussTests.hx b/tests/generated/src/tests/GaussTests.hx index 5a931341..2b46c70b 100644 --- a/tests/generated/src/tests/GaussTests.hx +++ b/tests/generated/src/tests/GaussTests.hx @@ -9,11 +9,16 @@ import vision.ds.Image; import vision.ds.Array2D; import vision.exceptions.InvalidGaussianKernelSize; +@:access(vision.algorithms.Gauss) class GaussTests { public static function vision_algorithms_Gauss__fastBlur__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Gauss.fastBlur((null : Image), (null : Int), (null : Float)); + var image = new vision.ds.Image(100, 100); + var size = 0; + var sigma = 0.0; + + result = vision.algorithms.Gauss.fastBlur(image, size, sigma); } catch (e) { } @@ -29,7 +34,10 @@ class GaussTests { public static function vision_algorithms_Gauss__createKernelOfSize__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Gauss.createKernelOfSize((null : Int), (null : Int)); + var size = 0; + var sigma = 0; + + result = vision.algorithms.Gauss.createKernelOfSize(size, sigma); } catch (e) { } diff --git a/tests/generated/src/tests/HistogramTests.hx b/tests/generated/src/tests/HistogramTests.hx index 6964ce87..4efd2012 100644 --- a/tests/generated/src/tests/HistogramTests.hx +++ b/tests/generated/src/tests/HistogramTests.hx @@ -6,10 +6,12 @@ import TestStatus; import vision.ds.Histogram; import haxe.ds.IntMap; +@:access(vision.ds.Histogram) class HistogramTests { public static function vision_ds_Histogram__length__ShouldWork():TestResult { var result = null; try { + var object = new vision.ds.Histogram(); result = object.length; } catch (e) { @@ -27,6 +29,7 @@ class HistogramTests { public static function vision_ds_Histogram__median__ShouldWork():TestResult { var result = null; try { + var object = new vision.ds.Histogram(); result = object.median; } catch (e) { @@ -44,8 +47,11 @@ class HistogramTests { public static function vision_ds_Histogram__increment__ShouldWork():TestResult { var result = null; try { + + var cell = 0; + var object = new vision.ds.Histogram(); - result = object.increment((null : Int)); + result = object.increment(cell); } catch (e) { } @@ -61,8 +67,11 @@ class HistogramTests { public static function vision_ds_Histogram__decrement__ShouldWork():TestResult { var result = null; try { + + var cell = 0; + var object = new vision.ds.Histogram(); - result = object.decrement((null : Int)); + result = object.decrement(cell); } catch (e) { } diff --git a/tests/generated/src/tests/ImageHashingTests.hx b/tests/generated/src/tests/ImageHashingTests.hx index 4d537f3a..4fecea24 100644 --- a/tests/generated/src/tests/ImageHashingTests.hx +++ b/tests/generated/src/tests/ImageHashingTests.hx @@ -11,11 +11,14 @@ import vision.ds.ByteArray; import vision.ds.Image; import vision.ds.ImageResizeAlgorithm; +@:access(vision.algorithms.ImageHashing) class ImageHashingTests { public static function vision_algorithms_ImageHashing__phash__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.ImageHashing.phash((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.algorithms.ImageHashing.phash(image); } catch (e) { } @@ -31,7 +34,10 @@ class ImageHashingTests { public static function vision_algorithms_ImageHashing__ahash__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.ImageHashing.ahash((null : Image), (null : Int)); + var image = new vision.ds.Image(100, 100); + var hashByteSize = 0; + + result = vision.algorithms.ImageHashing.ahash(image, hashByteSize); } catch (e) { } diff --git a/tests/generated/src/tests/ImageIOTests.hx b/tests/generated/src/tests/ImageIOTests.hx index b9ece22a..dcafb9a6 100644 --- a/tests/generated/src/tests/ImageIOTests.hx +++ b/tests/generated/src/tests/ImageIOTests.hx @@ -7,6 +7,7 @@ import vision.formats.ImageIO; import vision.formats.from.From; import vision.formats.to.To; +@:access(vision.formats.ImageIO) class ImageIOTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/Int16Point2DTests.hx b/tests/generated/src/tests/Int16Point2DTests.hx index 315b780c..d9da9d85 100644 --- a/tests/generated/src/tests/Int16Point2DTests.hx +++ b/tests/generated/src/tests/Int16Point2DTests.hx @@ -6,11 +6,15 @@ import TestStatus; import vision.ds.Int16Point2D; import vision.tools.MathTools; +@:access(vision.ds.Int16Point2D) class Int16Point2DTests { public static function vision_ds_Int16Point2D__x__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + var object = new vision.ds.Int16Point2D(X, Y); result = object.x; } catch (e) { @@ -27,7 +31,10 @@ class Int16Point2DTests { public static function vision_ds_Int16Point2D__y__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + var object = new vision.ds.Int16Point2D(X, Y); result = object.y; } catch (e) { @@ -44,7 +51,11 @@ class Int16Point2DTests { public static function vision_ds_Int16Point2D__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.Int16Point2D(X, Y); result = object.toString(); } catch (e) { @@ -61,7 +72,11 @@ class Int16Point2DTests { public static function vision_ds_Int16Point2D__toPoint2D__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.Int16Point2D(X, Y); result = object.toPoint2D(); } catch (e) { @@ -78,7 +93,11 @@ class Int16Point2DTests { public static function vision_ds_Int16Point2D__toIntPoint2D__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.Int16Point2D(X, Y); result = object.toIntPoint2D(); } catch (e) { @@ -95,7 +114,11 @@ class Int16Point2DTests { public static function vision_ds_Int16Point2D__toInt__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Int16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.Int16Point2D(X, Y); result = object.toInt(); } catch (e) { diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index ccb07936..ca45e73f 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -8,11 +8,15 @@ import vision.tools.MathTools; import vision.ds.Point2D; import haxe.Int64; +@:access(vision.ds.IntPoint2D) class IntPoint2DTests { public static function vision_ds_IntPoint2D__x__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + var x = 0; + var y = 0; + + var object = new vision.ds.IntPoint2D(x, y); result = object.x; } catch (e) { @@ -29,7 +33,10 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__y__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + var x = 0; + var y = 0; + + var object = new vision.ds.IntPoint2D(x, y); result = object.y; } catch (e) { @@ -46,7 +53,9 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__fromPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.ds.IntPoint2D.fromPoint2D((null : Point2D)); + var p = new vision.ds.Point2D(0, 0); + + result = vision.ds.IntPoint2D.fromPoint2D(p); } catch (e) { } @@ -62,7 +71,11 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + var x = 0; + var y = 0; + + + var object = new vision.ds.IntPoint2D(x, y); result = object.toString(); } catch (e) { @@ -79,7 +92,11 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__toPoint2D__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + var x = 0; + var y = 0; + + + var object = new vision.ds.IntPoint2D(x, y); result = object.toPoint2D(); } catch (e) { @@ -96,8 +113,13 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); - result = object.radiansTo((null : Point2D)); + var x = 0; + var y = 0; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.IntPoint2D(x, y); + result = object.radiansTo(point); } catch (e) { } @@ -113,8 +135,13 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__distanceTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); - result = object.distanceTo((null : IntPoint2D)); + var x = 0; + var y = 0; + + var point = new vision.ds.IntPoint2D(0, 0); + + var object = new vision.ds.IntPoint2D(x, y); + result = object.distanceTo(point); } catch (e) { } @@ -130,8 +157,13 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__degreesTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); - result = object.degreesTo((null : Point2D)); + var x = 0; + var y = 0; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.IntPoint2D(x, y); + result = object.degreesTo(point); } catch (e) { } @@ -147,7 +179,11 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__copy__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.IntPoint2D((null : Int), (null : Int)); + var x = 0; + var y = 0; + + + var object = new vision.ds.IntPoint2D(x, y); result = object.copy(); } catch (e) { diff --git a/tests/generated/src/tests/KMeansTests.hx b/tests/generated/src/tests/KMeansTests.hx index b65c1e7e..9e914818 100644 --- a/tests/generated/src/tests/KMeansTests.hx +++ b/tests/generated/src/tests/KMeansTests.hx @@ -9,6 +9,7 @@ import vision.ds.Image; import vision.ds.kmeans.ColorCluster; import vision.exceptions.Unimplemented; +@:access(vision.algorithms.KMeans) class KMeansTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/LaplaceTests.hx b/tests/generated/src/tests/LaplaceTests.hx index 8883be8a..177154c2 100644 --- a/tests/generated/src/tests/LaplaceTests.hx +++ b/tests/generated/src/tests/LaplaceTests.hx @@ -9,11 +9,18 @@ import vision.ds.Color; import vision.tools.ImageTools; import vision.ds.Image; +@:access(vision.algorithms.Laplace) class LaplaceTests { public static function vision_algorithms_Laplace__laplacianOfGaussian__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Laplace.laplacianOfGaussian((null : Image), (null : GaussianKernelSize), (null : Float), (null : Float), (null : Bool)); + var image = new vision.ds.Image(100, 100); + var kernelSize:GaussianKernelSize = null; + var sigma = 0.0; + var threshold = 0.0; + var positive = false; + + result = vision.algorithms.Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, positive); } catch (e) { } @@ -29,7 +36,10 @@ class LaplaceTests { public static function vision_algorithms_Laplace__convolveWithLaplacianOperator__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Laplace.convolveWithLaplacianOperator((null : Image), (null : Bool)); + var image = new vision.ds.Image(100, 100); + var positive = false; + + result = vision.algorithms.Laplace.convolveWithLaplacianOperator(image, positive); } catch (e) { } diff --git a/tests/generated/src/tests/Line2DTests.hx b/tests/generated/src/tests/Line2DTests.hx new file mode 100644 index 00000000..39f868c8 --- /dev/null +++ b/tests/generated/src/tests/Line2DTests.hx @@ -0,0 +1,163 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Line2D; +import vision.tools.MathTools; + +@:access(vision.ds.Line2D) +class Line2DTests { + public static function vision_ds_Line2D__length__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Line2D(start, end); + result = object.length; + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#length", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__middle__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Line2D(start, end); + result = object.middle; + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#middle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__fromRay2D__ShouldWork():TestResult { + var result = null; + try { + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.ds.Line2D.fromRay2D(ray); + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D.fromRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__toString__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + + var object = new vision.ds.Line2D(start, end); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__toRay2D__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + + var object = new vision.ds.Line2D(start, end); + result = object.toRay2D(); + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#toRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__intersect__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + var object = new vision.ds.Line2D(start, end); + result = object.intersect(line); + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#intersect", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Line2D__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var start = new vision.ds.Point2D(0, 0); + var end = new vision.ds.Point2D(0, 0); + + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + var object = new vision.ds.Line2D(start, end); + result = object.distanceTo(line); + } catch (e) { + + } + + return { + testName: "vision.ds.Line2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Line2D__fromRay2D__ShouldWork, + vision_ds_Line2D__toString__ShouldWork, + vision_ds_Line2D__toRay2D__ShouldWork, + vision_ds_Line2D__intersect__ShouldWork, + vision_ds_Line2D__distanceTo__ShouldWork, + vision_ds_Line2D__length__ShouldWork, + vision_ds_Line2D__middle__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index aed2c382..7ee3a230 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -17,6 +17,7 @@ import vision.ds.Ray2D; import vision.ds.Line2D; import vision.ds.Point2D; +@:access(vision.tools.MathTools) class MathToolsTests { public static function vision_tools_MathTools__PI__ShouldWork():TestResult { var result = null; @@ -133,7 +134,11 @@ class MathToolsTests { public static function vision_tools_MathTools__wrapInt__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.wrapInt((null : Int), (null : Int), (null : Int)); + var value = 0; + var min = 0; + var max = 0; + + result = vision.tools.MathTools.wrapInt(value, min, max); } catch (e) { } @@ -149,7 +154,11 @@ class MathToolsTests { public static function vision_tools_MathTools__wrapFloat__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.wrapFloat((null : Float), (null : Float), (null : Float)); + var value = 0.0; + var min = 0.0; + var max = 0.0; + + result = vision.tools.MathTools.wrapFloat(value, min, max); } catch (e) { } @@ -165,7 +174,10 @@ class MathToolsTests { public static function vision_tools_MathTools__truncate__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.truncate((null : Float), (null : Int)); + var num = 0.0; + var numbersAfterDecimal = 0; + + result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); } catch (e) { } @@ -181,7 +193,9 @@ class MathToolsTests { public static function vision_tools_MathTools__toFloat__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.toFloat((null : Int64)); + var value:Int64 = null; + + result = vision.tools.MathTools.toFloat(value); } catch (e) { } @@ -197,7 +211,9 @@ class MathToolsTests { public static function vision_tools_MathTools__tand__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.tand((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.tand(degrees); } catch (e) { } @@ -213,7 +229,9 @@ class MathToolsTests { public static function vision_tools_MathTools__tan__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.tan((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.tan(radians); } catch (e) { } @@ -229,7 +247,9 @@ class MathToolsTests { public static function vision_tools_MathTools__sqrt__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.sqrt((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.sqrt(v); } catch (e) { } @@ -245,7 +265,9 @@ class MathToolsTests { public static function vision_tools_MathTools__slopeToRadians__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.slopeToRadians((null : Float)); + var slope = 0.0; + + result = vision.tools.MathTools.slopeToRadians(slope); } catch (e) { } @@ -261,7 +283,9 @@ class MathToolsTests { public static function vision_tools_MathTools__slopeToDegrees__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.slopeToDegrees((null : Float)); + var slope = 0.0; + + result = vision.tools.MathTools.slopeToDegrees(slope); } catch (e) { } @@ -277,7 +301,10 @@ class MathToolsTests { public static function vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.slopeFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); } catch (e) { } @@ -293,7 +320,9 @@ class MathToolsTests { public static function vision_tools_MathTools__sind__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.sind((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.sind(degrees); } catch (e) { } @@ -309,7 +338,9 @@ class MathToolsTests { public static function vision_tools_MathTools__sin__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.sin((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.sin(radians); } catch (e) { } @@ -325,7 +356,9 @@ class MathToolsTests { public static function vision_tools_MathTools__secd__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.secd((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.secd(degrees); } catch (e) { } @@ -341,7 +374,9 @@ class MathToolsTests { public static function vision_tools_MathTools__sec__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.sec((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.sec(radians); } catch (e) { } @@ -357,7 +392,9 @@ class MathToolsTests { public static function vision_tools_MathTools__round__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.round((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.round(v); } catch (e) { } @@ -373,6 +410,7 @@ class MathToolsTests { public static function vision_tools_MathTools__random__ShouldWork():TestResult { var result = null; try { + result = vision.tools.MathTools.random(); } catch (e) { @@ -389,7 +427,9 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.radiansToSlope((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.radiansToSlope(radians); } catch (e) { } @@ -405,7 +445,9 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansToDegrees__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.radiansToDegrees((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.radiansToDegrees(radians); } catch (e) { } @@ -421,7 +463,10 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.radiansFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); } catch (e) { } @@ -437,7 +482,10 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.radiansFromPointToLine2D((null : IntPoint2D), (null : Line2D)); + var point = new vision.ds.IntPoint2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); } catch (e) { } @@ -453,7 +501,10 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.radiansFromLineToPoint2D((null : Line2D), (null : Point2D)); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var point = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.radiansFromLineToPoint2D(line, point); } catch (e) { } @@ -469,7 +520,10 @@ class MathToolsTests { public static function vision_tools_MathTools__pow__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.pow((null : Float), (null : Float)); + var v = 0.0; + var exp = 0.0; + + result = vision.tools.MathTools.pow(v, exp); } catch (e) { } @@ -485,7 +539,9 @@ class MathToolsTests { public static function vision_tools_MathTools__parseInt__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.parseInt((null : String)); + var s = ""; + + result = vision.tools.MathTools.parseInt(s); } catch (e) { } @@ -501,7 +557,9 @@ class MathToolsTests { public static function vision_tools_MathTools__parseFloat__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.parseFloat((null : String)); + var s = ""; + + result = vision.tools.MathTools.parseFloat(s); } catch (e) { } @@ -517,7 +575,9 @@ class MathToolsTests { public static function vision_tools_MathTools__parseBool__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.parseBool((null : String)); + var s = ""; + + result = vision.tools.MathTools.parseBool(s); } catch (e) { } @@ -533,7 +593,10 @@ class MathToolsTests { public static function vision_tools_MathTools__mirrorInsideRectangle__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.mirrorInsideRectangle((null : Line2D), (null : Rectangle)); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; + + result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); } catch (e) { } @@ -549,7 +612,9 @@ class MathToolsTests { public static function vision_tools_MathTools__log__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.log((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.log(v); } catch (e) { } @@ -565,7 +630,9 @@ class MathToolsTests { public static function vision_tools_MathTools__isNaN__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.isNaN((null : Float)); + var f = 0.0; + + result = vision.tools.MathTools.isNaN(f); } catch (e) { } @@ -581,7 +648,9 @@ class MathToolsTests { public static function vision_tools_MathTools__isInt__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.isInt((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.isInt(v); } catch (e) { } @@ -597,7 +666,9 @@ class MathToolsTests { public static function vision_tools_MathTools__isFinite__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.isFinite((null : Float)); + var f = 0.0; + + result = vision.tools.MathTools.isFinite(f); } catch (e) { } @@ -613,7 +684,10 @@ class MathToolsTests { public static function vision_tools_MathTools__isBetweenRanges__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.isBetweenRanges((null : Float), (null : {start:Float, end:Float})); + var value = 0.0; + var ranges:{start:Float, end:Float} = null; + + result = vision.tools.MathTools.isBetweenRanges(value, ranges); } catch (e) { } @@ -629,7 +703,11 @@ class MathToolsTests { public static function vision_tools_MathTools__isBetweenRange__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.isBetweenRange((null : Float), (null : Float), (null : Float)); + var value = 0.0; + var min = 0.0; + var max = 0.0; + + result = vision.tools.MathTools.isBetweenRange(value, min, max); } catch (e) { } @@ -645,7 +723,10 @@ class MathToolsTests { public static function vision_tools_MathTools__invertInsideRectangle__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.invertInsideRectangle((null : Line2D), (null : Rectangle)); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; + + result = vision.tools.MathTools.invertInsideRectangle(line, rect); } catch (e) { } @@ -661,7 +742,10 @@ class MathToolsTests { public static function vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.intersectionBetweenRay2Ds((null : Ray2D), (null : Ray2D)); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); } catch (e) { } @@ -677,7 +761,10 @@ class MathToolsTests { public static function vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.intersectionBetweenLine2Ds((null : Line2D), (null : Line2D)); + var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); } catch (e) { } @@ -693,7 +780,10 @@ class MathToolsTests { public static function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.getClosestPointOnRay2D((null : IntPoint2D), (null : Ray2D)); + var point = new vision.ds.IntPoint2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); } catch (e) { } @@ -709,7 +799,9 @@ class MathToolsTests { public static function vision_tools_MathTools__gamma__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.gamma((null : Float)); + var x = 0.0; + + result = vision.tools.MathTools.gamma(x); } catch (e) { } @@ -725,7 +817,9 @@ class MathToolsTests { public static function vision_tools_MathTools__fround__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.fround((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.fround(v); } catch (e) { } @@ -741,7 +835,9 @@ class MathToolsTests { public static function vision_tools_MathTools__floor__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.floor((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.floor(v); } catch (e) { } @@ -757,7 +853,10 @@ class MathToolsTests { public static function vision_tools_MathTools__flipInsideRectangle__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.flipInsideRectangle((null : Line2D), (null : Rectangle)); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; + + result = vision.tools.MathTools.flipInsideRectangle(line, rect); } catch (e) { } @@ -773,7 +872,12 @@ class MathToolsTests { public static function vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.findPointAtDistanceUsingY((null : Ray2D), (null : Float), (null : Float), (null : Bool)); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var startYPos = 0.0; + var distance = 0.0; + var goPositive = false; + + result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); } catch (e) { } @@ -789,7 +893,12 @@ class MathToolsTests { public static function vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.findPointAtDistanceUsingX((null : Ray2D), (null : Float), (null : Float), (null : Bool)); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var startXPos = 0.0; + var distance = 0.0; + var goPositive = false; + + result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); } catch (e) { } @@ -805,7 +914,9 @@ class MathToolsTests { public static function vision_tools_MathTools__ffloor__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.ffloor((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.ffloor(v); } catch (e) { } @@ -821,7 +932,9 @@ class MathToolsTests { public static function vision_tools_MathTools__fceil__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.fceil((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.fceil(v); } catch (e) { } @@ -837,7 +950,9 @@ class MathToolsTests { public static function vision_tools_MathTools__factorial__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.factorial((null : Float)); + var value = 0.0; + + result = vision.tools.MathTools.factorial(value); } catch (e) { } @@ -853,7 +968,9 @@ class MathToolsTests { public static function vision_tools_MathTools__exp__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.exp((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.exp(v); } catch (e) { } @@ -869,7 +986,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceFromRayToPoint2D((null : Ray2D), (null : Point2D)); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var point = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); } catch (e) { } @@ -885,7 +1005,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceFromPointToRay2D((null : IntPoint2D), (null : Ray2D)); + var point = new vision.ds.IntPoint2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); } catch (e) { } @@ -901,7 +1024,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceFromPointToLine2D((null : IntPoint2D), (null : Line2D)); + var point = new vision.ds.IntPoint2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); } catch (e) { } @@ -917,7 +1043,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceFromLineToPoint2D((null : Line2D), (null : Point2D)); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var point = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); } catch (e) { } @@ -933,7 +1062,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceBetweenRays2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceBetweenRays2D((null : Ray2D), (null : Ray2D)); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); } catch (e) { } @@ -949,7 +1081,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceBetweenPoints__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceBetweenPoints((null : Point3D), (null : Point3D)); + var point1:Point3D = null; + var point2:Point3D = null; + + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } @@ -965,7 +1100,10 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceBetweenLines2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.distanceBetweenLines2D((null : Line2D), (null : Line2D)); + var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); } catch (e) { } @@ -981,7 +1119,9 @@ class MathToolsTests { public static function vision_tools_MathTools__degreesToSlope__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.degreesToSlope((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.degreesToSlope(degrees); } catch (e) { } @@ -997,7 +1137,9 @@ class MathToolsTests { public static function vision_tools_MathTools__degreesToRadians__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.degreesToRadians((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.degreesToRadians(degrees); } catch (e) { } @@ -1013,7 +1155,10 @@ class MathToolsTests { public static function vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.degreesFromPointToPoint2D((null : IntPoint2D), (null : Point2D)); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); + + result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); } catch (e) { } @@ -1029,7 +1174,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cropDecimal__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cropDecimal((null : Float)); + var number = 0.0; + + result = vision.tools.MathTools.cropDecimal(number); } catch (e) { } @@ -1045,7 +1192,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cotand__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cotand((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.cotand(degrees); } catch (e) { } @@ -1061,7 +1210,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cotan__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cotan((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.cotan(radians); } catch (e) { } @@ -1077,7 +1228,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cosecd__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cosecd((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.cosecd(degrees); } catch (e) { } @@ -1093,7 +1246,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cosec__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cosec((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.cosec(radians); } catch (e) { } @@ -1109,7 +1264,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cosd__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cosd((null : Float)); + var degrees = 0.0; + + result = vision.tools.MathTools.cosd(degrees); } catch (e) { } @@ -1125,7 +1282,9 @@ class MathToolsTests { public static function vision_tools_MathTools__cos__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.cos((null : Float)); + var radians = 0.0; + + result = vision.tools.MathTools.cos(radians); } catch (e) { } @@ -1141,7 +1300,11 @@ class MathToolsTests { public static function vision_tools_MathTools__clamp__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.clamp((null : Int), (null : Int), (null : Int)); + var value = 0; + var mi = 0; + var ma = 0; + + result = vision.tools.MathTools.clamp(value, mi, ma); } catch (e) { } @@ -1157,7 +1320,9 @@ class MathToolsTests { public static function vision_tools_MathTools__ceil__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.ceil((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.ceil(v); } catch (e) { } @@ -1173,7 +1338,11 @@ class MathToolsTests { public static function vision_tools_MathTools__boundInt__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.boundInt((null : Int), (null : Int), (null : Int)); + var value = 0; + var min = 0; + var max = 0; + + result = vision.tools.MathTools.boundInt(value, min, max); } catch (e) { } @@ -1189,7 +1358,11 @@ class MathToolsTests { public static function vision_tools_MathTools__boundFloat__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.boundFloat((null : Float), (null : Float), (null : Float)); + var value = 0.0; + var min = 0.0; + var max = 0.0; + + result = vision.tools.MathTools.boundFloat(value, min, max); } catch (e) { } @@ -1205,7 +1378,10 @@ class MathToolsTests { public static function vision_tools_MathTools__atan2__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.atan2((null : Float), (null : Float)); + var y = 0.0; + var x = 0.0; + + result = vision.tools.MathTools.atan2(y, x); } catch (e) { } @@ -1221,7 +1397,9 @@ class MathToolsTests { public static function vision_tools_MathTools__atan__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.atan((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.atan(v); } catch (e) { } @@ -1237,7 +1415,9 @@ class MathToolsTests { public static function vision_tools_MathTools__asin__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.asin((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.asin(v); } catch (e) { } @@ -1253,7 +1433,9 @@ class MathToolsTests { public static function vision_tools_MathTools__acos__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.acos((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.acos(v); } catch (e) { } @@ -1269,7 +1451,9 @@ class MathToolsTests { public static function vision_tools_MathTools__abs__ShouldWork():TestResult { var result = null; try { - result = vision.tools.MathTools.abs((null : Float)); + var v = 0.0; + + result = vision.tools.MathTools.abs(v); } catch (e) { } diff --git a/tests/generated/src/tests/PerspectiveWarpTests.hx b/tests/generated/src/tests/PerspectiveWarpTests.hx index b484e2ec..6c2a0b0b 100644 --- a/tests/generated/src/tests/PerspectiveWarpTests.hx +++ b/tests/generated/src/tests/PerspectiveWarpTests.hx @@ -7,11 +7,15 @@ import vision.algorithms.PerspectiveWarp; import vision.ds.Matrix2D; import vision.ds.Point2D; +@:access(vision.algorithms.PerspectiveWarp) class PerspectiveWarpTests { public static function vision_algorithms_PerspectiveWarp__generateMatrix__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.PerspectiveWarp.generateMatrix((null : Array), (null : Array)); + var destinationPoints = []; + var sourcePoints = []; + + result = vision.algorithms.PerspectiveWarp.generateMatrix(destinationPoints, sourcePoints); } catch (e) { } diff --git a/tests/generated/src/tests/PerwittTests.hx b/tests/generated/src/tests/PerwittTests.hx index c3784053..34057df3 100644 --- a/tests/generated/src/tests/PerwittTests.hx +++ b/tests/generated/src/tests/PerwittTests.hx @@ -8,11 +8,15 @@ import vision.ds.Color; import vision.tools.ImageTools; import vision.ds.Image; +@:access(vision.algorithms.Perwitt) class PerwittTests { public static function vision_algorithms_Perwitt__detectEdges__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Perwitt.detectEdges((null : Image), (null : Float)); + var image = new vision.ds.Image(100, 100); + var threshold = 0.0; + + result = vision.algorithms.Perwitt.detectEdges(image, threshold); } catch (e) { } @@ -28,7 +32,9 @@ class PerwittTests { public static function vision_algorithms_Perwitt__convolveWithPerwittOperator__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Perwitt.convolveWithPerwittOperator((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.algorithms.Perwitt.convolveWithPerwittOperator(image); } catch (e) { } diff --git a/tests/generated/src/tests/PixelTests.hx b/tests/generated/src/tests/PixelTests.hx index e3f165a1..2f0dba35 100644 --- a/tests/generated/src/tests/PixelTests.hx +++ b/tests/generated/src/tests/PixelTests.hx @@ -6,6 +6,7 @@ import TestStatus; import vision.ds.Pixel; +@:access(vision.ds.Pixel) class PixelTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx index da7999a7..257efab6 100644 --- a/tests/generated/src/tests/Point2DTests.hx +++ b/tests/generated/src/tests/Point2DTests.hx @@ -6,11 +6,16 @@ import TestStatus; import vision.ds.Point2D; import vision.tools.MathTools; +@:access(vision.ds.Point2D) class Point2DTests { public static function vision_ds_Point2D__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point2D((null : Float), (null : Float)); + var x = 0.0; + var y = 0.0; + + + var object = new vision.ds.Point2D(x, y); result = object.toString(); } catch (e) { @@ -27,8 +32,13 @@ class Point2DTests { public static function vision_ds_Point2D__radiansTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point2D((null : Float), (null : Float)); - result = object.radiansTo((null : Point2D)); + var x = 0.0; + var y = 0.0; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Point2D(x, y); + result = object.radiansTo(point); } catch (e) { } @@ -44,8 +54,13 @@ class Point2DTests { public static function vision_ds_Point2D__distanceTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point2D((null : Float), (null : Float)); - result = object.distanceTo((null : Point2D)); + var x = 0.0; + var y = 0.0; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Point2D(x, y); + result = object.distanceTo(point); } catch (e) { } @@ -61,8 +76,13 @@ class Point2DTests { public static function vision_ds_Point2D__degreesTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point2D((null : Float), (null : Float)); - result = object.degreesTo((null : Point2D)); + var x = 0.0; + var y = 0.0; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Point2D(x, y); + result = object.degreesTo(point); } catch (e) { } @@ -78,7 +98,11 @@ class Point2DTests { public static function vision_ds_Point2D__copy__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point2D((null : Float), (null : Float)); + var x = 0.0; + var y = 0.0; + + + var object = new vision.ds.Point2D(x, y); result = object.copy(); } catch (e) { diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx index 5d850fe8..644b01d4 100644 --- a/tests/generated/src/tests/Point3DTests.hx +++ b/tests/generated/src/tests/Point3DTests.hx @@ -6,11 +6,17 @@ import TestStatus; import vision.ds.Point3D; import vision.tools.MathTools; +@:access(vision.ds.Point3D) class Point3DTests { public static function vision_ds_Point3D__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); + var x = 0.0; + var y = 0.0; + var z = 0.0; + + + var object = new vision.ds.Point3D(x, y, z); result = object.toString(); } catch (e) { @@ -27,8 +33,14 @@ class Point3DTests { public static function vision_ds_Point3D__distanceTo__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); - result = object.distanceTo((null : Point3D)); + var x = 0.0; + var y = 0.0; + var z = 0.0; + + var point:Point3D = null; + + var object = new vision.ds.Point3D(x, y, z); + result = object.distanceTo(point); } catch (e) { } @@ -44,7 +56,12 @@ class Point3DTests { public static function vision_ds_Point3D__copy__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.Point3D((null : Float), (null : Float), (null : Float)); + var x = 0.0; + var y = 0.0; + var z = 0.0; + + + var object = new vision.ds.Point3D(x, y, z); result = object.copy(); } catch (e) { diff --git a/tests/generated/src/tests/PointTransformationPairTests.hx b/tests/generated/src/tests/PointTransformationPairTests.hx index 099b930f..6fea25e3 100644 --- a/tests/generated/src/tests/PointTransformationPairTests.hx +++ b/tests/generated/src/tests/PointTransformationPairTests.hx @@ -6,6 +6,7 @@ import TestStatus; import vision.ds.specifics.PointTransformationPair; +@:access(vision.ds.specifics.PointTransformationPair) class PointTransformationPairTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/QueueCellTests.hx b/tests/generated/src/tests/QueueCellTests.hx deleted file mode 100644 index 00a5733d..00000000 --- a/tests/generated/src/tests/QueueCellTests.hx +++ /dev/null @@ -1,29 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.QueueCell; - - -class QueueCellTests { - public static function vision_ds_QueueCell__getValue__ShouldWork():TestResult { - var result = null; - try { - var object = new vision.ds.QueueCell((null : T), (null : QueueCell), (null : QueueCell)); - result = object.getValue(); - } catch (e) { - - } - - return { - testName: "vision.ds.QueueCell#getValue", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static var tests = [ - vision_ds_QueueCell__getValue__ShouldWork]; -} \ No newline at end of file diff --git a/tests/generated/src/tests/QueueTests.hx b/tests/generated/src/tests/QueueTests.hx new file mode 100644 index 00000000..2930377d --- /dev/null +++ b/tests/generated/src/tests/QueueTests.hx @@ -0,0 +1,113 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Queue; + + +@:access(vision.ds.Queue) +class QueueTests { + public static function vision_ds_Queue__last__ShouldWork():TestResult { + var result = null; + try { + + var object = new vision.ds.Queue(); + result = object.last; + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#last", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Queue__toString__ShouldWork():TestResult { + var result = null; + try { + + + var object = new vision.ds.Queue(); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Queue__has__ShouldWork():TestResult { + var result = null; + try { + + var value = 0; + + var object = new vision.ds.Queue(); + result = object.has(value); + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#has", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Queue__enqueue__ShouldWork():TestResult { + var result = null; + try { + + var value = 0; + + var object = new vision.ds.Queue(); + result = object.enqueue(value); + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#enqueue", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Queue__dequeue__ShouldWork():TestResult { + var result = null; + try { + + + var object = new vision.ds.Queue(); + result = object.dequeue(); + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#dequeue", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Queue__toString__ShouldWork, + vision_ds_Queue__has__ShouldWork, + vision_ds_Queue__enqueue__ShouldWork, + vision_ds_Queue__dequeue__ShouldWork, + vision_ds_Queue__last__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx index d287629b..c68c0583 100644 --- a/tests/generated/src/tests/RadixTests.hx +++ b/tests/generated/src/tests/RadixTests.hx @@ -8,6 +8,7 @@ import vision.tools.ArrayTools; import haxe.extern.EitherType; import haxe.Int64; +@:access(vision.algorithms.Radix) class RadixTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/Ray2DTests.hx b/tests/generated/src/tests/Ray2DTests.hx new file mode 100644 index 00000000..d2967b8d --- /dev/null +++ b/tests/generated/src/tests/Ray2DTests.hx @@ -0,0 +1,178 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Ray2D; +import vision.tools.MathTools; + +@:access(vision.ds.Ray2D) +class Ray2DTests { + public static function vision_ds_Ray2D__yIntercept__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.yIntercept; + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#yIntercept", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__xIntercept__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.xIntercept; + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#xIntercept", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__from2Points__ShouldWork():TestResult { + var result = null; + try { + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); + + result = vision.ds.Ray2D.from2Points(point1, point2); + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D.from2Points", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__intersect__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.intersect(ray); + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#intersect", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__getPointAtY__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var y = 0.0; + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.getPointAtY(y); + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#getPointAtY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__getPointAtX__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var x = 0.0; + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.getPointAtX(x); + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#getPointAtX", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Ray2D__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var point = new vision.ds.Point2D(0, 0); + var m = 0.0; + var degrees = 0.0; + var radians = 0.0; + + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + var object = new vision.ds.Ray2D(point, m, degrees, radians); + result = object.distanceTo(ray); + } catch (e) { + + } + + return { + testName: "vision.ds.Ray2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_ds_Ray2D__from2Points__ShouldWork, + vision_ds_Ray2D__intersect__ShouldWork, + vision_ds_Ray2D__getPointAtY__ShouldWork, + vision_ds_Ray2D__getPointAtX__ShouldWork, + vision_ds_Ray2D__distanceTo__ShouldWork, + vision_ds_Ray2D__yIntercept__ShouldWork, + vision_ds_Ray2D__xIntercept__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generated/src/tests/RectangleTests.hx b/tests/generated/src/tests/RectangleTests.hx index 700dd463..83f42be4 100644 --- a/tests/generated/src/tests/RectangleTests.hx +++ b/tests/generated/src/tests/RectangleTests.hx @@ -6,6 +6,7 @@ import TestStatus; import vision.ds.Rectangle; +@:access(vision.ds.Rectangle) class RectangleTests { public static var tests = []; } \ No newline at end of file diff --git a/tests/generated/src/tests/RobertsCrossTests.hx b/tests/generated/src/tests/RobertsCrossTests.hx index 15ea0fef..787679ee 100644 --- a/tests/generated/src/tests/RobertsCrossTests.hx +++ b/tests/generated/src/tests/RobertsCrossTests.hx @@ -7,11 +7,14 @@ import vision.algorithms.RobertsCross; import vision.tools.ImageTools; import vision.ds.Image; +@:access(vision.algorithms.RobertsCross) class RobertsCrossTests { public static function vision_algorithms_RobertsCross__convolveWithRobertsCross__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.RobertsCross.convolveWithRobertsCross((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.algorithms.RobertsCross.convolveWithRobertsCross(image); } catch (e) { } diff --git a/tests/generated/src/tests/SimpleHoughTests.hx b/tests/generated/src/tests/SimpleHoughTests.hx index 2cc837b7..51cae1a4 100644 --- a/tests/generated/src/tests/SimpleHoughTests.hx +++ b/tests/generated/src/tests/SimpleHoughTests.hx @@ -8,11 +8,15 @@ import vision.ds.Color; import vision.ds.Ray2D; import vision.ds.Image; +@:access(vision.algorithms.SimpleHough) class SimpleHoughTests { public static function vision_algorithms_SimpleHough__mapLines__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.SimpleHough.mapLines((null : Image), (null : Array)); + var image = new vision.ds.Image(100, 100); + var rays = []; + + result = vision.algorithms.SimpleHough.mapLines(image, rays); } catch (e) { } diff --git a/tests/generated/src/tests/SimpleLineDetectorTests.hx b/tests/generated/src/tests/SimpleLineDetectorTests.hx index 0ea473a4..ff9eea47 100644 --- a/tests/generated/src/tests/SimpleLineDetectorTests.hx +++ b/tests/generated/src/tests/SimpleLineDetectorTests.hx @@ -10,11 +10,15 @@ import vision.ds.Line2D; import vision.ds.Image; import vision.ds.IntPoint2D; +@:access(vision.algorithms.SimpleLineDetector) class SimpleLineDetectorTests { public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.SimpleLineDetector.lineCoveragePercentage((null : Image), (null : Line2D)); + var image = new vision.ds.Image(100, 100); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.algorithms.SimpleLineDetector.lineCoveragePercentage(image, line); } catch (e) { } @@ -30,7 +34,13 @@ class SimpleLineDetectorTests { public static function vision_algorithms_SimpleLineDetector__findLineFromPoint__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.SimpleLineDetector.findLineFromPoint((null : Image), (null : Int16Point2D), (null : Float), (null : Bool), (null : Bool)); + var image = new vision.ds.Image(100, 100); + var point = new vision.ds.Int16Point2D(0, 0); + var minLineLength = 0.0; + var preferTTB = false; + var preferRTL = false; + + result = vision.algorithms.SimpleLineDetector.findLineFromPoint(image, point, minLineLength, preferTTB, preferRTL); } catch (e) { } diff --git a/tests/generated/src/tests/SobelTests.hx b/tests/generated/src/tests/SobelTests.hx index 6d6304fa..121c6e3e 100644 --- a/tests/generated/src/tests/SobelTests.hx +++ b/tests/generated/src/tests/SobelTests.hx @@ -8,11 +8,15 @@ import vision.ds.Color; import vision.tools.ImageTools; import vision.ds.Image; +@:access(vision.algorithms.Sobel) class SobelTests { public static function vision_algorithms_Sobel__detectEdges__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Sobel.detectEdges((null : Image), (null : Float)); + var image = new vision.ds.Image(100, 100); + var threshold = 0.0; + + result = vision.algorithms.Sobel.detectEdges(image, threshold); } catch (e) { } @@ -28,7 +32,9 @@ class SobelTests { public static function vision_algorithms_Sobel__convolveWithSobelOperator__ShouldWork():TestResult { var result = null; try { - result = vision.algorithms.Sobel.convolveWithSobelOperator((null : Image)); + var image = new vision.ds.Image(100, 100); + + result = vision.algorithms.Sobel.convolveWithSobelOperator(image); } catch (e) { } diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx index 33baf1b6..8d2e4a70 100644 --- a/tests/generated/src/tests/UInt16Point2DTests.hx +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -6,11 +6,15 @@ import TestStatus; import vision.ds.UInt16Point2D; +@:access(vision.ds.UInt16Point2D) class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__x__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.x; } catch (e) { @@ -27,7 +31,10 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__y__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.y; } catch (e) { @@ -44,7 +51,11 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toString__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.toString(); } catch (e) { @@ -61,7 +72,11 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toPoint2D__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.toPoint2D(); } catch (e) { @@ -78,7 +93,11 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toIntPoint2D__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.toIntPoint2D(); } catch (e) { @@ -95,7 +114,11 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toInt__ShouldWork():TestResult { var result = null; try { - var object = new vision.ds.UInt16Point2D((null : Int), (null : Int)); + var X = 0; + var Y = 0; + + + var object = new vision.ds.UInt16Point2D(X, Y); result = object.toInt(); } catch (e) { diff --git a/tests/generated/src/tests/VisionTests.hx b/tests/generated/src/tests/VisionTests.hx new file mode 100644 index 00000000..fb4faf7b --- /dev/null +++ b/tests/generated/src/tests/VisionTests.hx @@ -0,0 +1,965 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.Vision; +import vision.algorithms.ImageHashing; +import vision.ds.ByteArray; +import vision.ds.kmeans.ColorCluster; +import haxe.io.Bytes; +import haxe.crypto.Sha256; +import vision.exceptions.Unimplemented; +import vision.ds.specifics.SimilarityScoringMechanism; +import vision.algorithms.KMeans; +import vision.ds.specifics.ColorChannel; +import vision.ds.TransformationMatrix2D; +import vision.ds.specifics.TransformationMatrixOrigination; +import vision.ds.Point3D; +import vision.ds.specifics.ImageExpansionMode; +import vision.algorithms.PerspectiveWarp; +import vision.ds.specifics.PointTransformationPair; +import vision.algorithms.BilinearInterpolation; +import vision.ds.Matrix2D; +import vision.ds.Int16Point2D; +import haxe.ds.Vector; +import vision.ds.specifics.WhiteNoiseRange; +import vision.algorithms.Laplace; +import vision.ds.specifics.ColorImportanceOrder; +import vision.algorithms.BilateralFilter; +import vision.algorithms.RobertsCross; +import vision.ds.IntPoint2D; +import haxe.extern.EitherType; +import vision.algorithms.Radix; +import haxe.ds.ArraySort; +import vision.ds.Histogram; +import vision.ds.specifics.AlgorithmSettings; +import vision.algorithms.Perwitt; +import vision.algorithms.Sobel; +import vision.ds.Kernel2D; +import vision.ds.canny.CannyObject; +import vision.algorithms.SimpleLineDetector; +import vision.ds.gaussian.GaussianKernelSize; +import vision.ds.Ray2D; +import vision.algorithms.Gauss; +import vision.ds.Point2D; +import vision.ds.Line2D; +import vision.ds.Color; +import vision.ds.Image; +import vision.tools.MathTools; +import vision.tools.MathTools.*; + +@:access(vision.Vision) +class VisionTests { + public static function vision_Vision__whiteNoise__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var percentage = 0.0; + var whiteNoiseRange:WhiteNoiseRange = null; + + result = vision.Vision.whiteNoise(image, percentage, whiteNoiseRange); + } catch (e) { + + } + + return { + testName: "vision.Vision.whiteNoise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__vignette__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + var intensity = 0.0; + var ratioDependent = false; + var color:Color = null; + + result = vision.Vision.vignette(image, strength, intensity, ratioDependent, color); + } catch (e) { + + } + + return { + testName: "vision.Vision.vignette", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__tint__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var withColor:Color = null; + var percentage = 0.0; + + result = vision.Vision.tint(image, withColor, percentage); + } catch (e) { + + } + + return { + testName: "vision.Vision.tint", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__sobelEdgeDiffOperator__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.sobelEdgeDiffOperator(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.sobelEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__sobelEdgeDetection__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var threshold = 0.0; + + result = vision.Vision.sobelEdgeDetection(image, threshold); + } catch (e) { + + } + + return { + testName: "vision.Vision.sobelEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__smooth__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + var affectAlpha = false; + var kernelRadius = 0; + var circularKernel = false; + var iterations = 0; + + result = vision.Vision.smooth(image, strength, affectAlpha, kernelRadius, circularKernel, iterations); + } catch (e) { + + } + + return { + testName: "vision.Vision.smooth", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__simpleImageSimilarity__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var compared = new vision.ds.Image(100, 100); + var scoringMechanism:SimilarityScoringMechanism = null; + + result = vision.Vision.simpleImageSimilarity(image, compared, scoringMechanism); + } catch (e) { + + } + + return { + testName: "vision.Vision.simpleImageSimilarity", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__sharpen__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.sharpen(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.sharpen", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__sepia__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + + result = vision.Vision.sepia(image, strength); + } catch (e) { + + } + + return { + testName: "vision.Vision.sepia", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__saltAndPepperNoise__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var percentage = 0.0; + + result = vision.Vision.saltAndPepperNoise(image, percentage); + } catch (e) { + + } + + return { + testName: "vision.Vision.saltAndPepperNoise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__robertEdgeDiffOperator__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.robertEdgeDiffOperator(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.robertEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__replaceColorRanges__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var ranges:Array<{rangeStart:Color, rangeEnd:Color, replacement:Color}> = null; + + result = vision.Vision.replaceColorRanges(image, ranges); + } catch (e) { + + } + + return { + testName: "vision.Vision.replaceColorRanges", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__projectiveTransform__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var matrix:TransformationMatrix2D = null; + var expansionMode:ImageExpansionMode = null; + + result = vision.Vision.projectiveTransform(image, matrix, expansionMode); + } catch (e) { + + } + + return { + testName: "vision.Vision.projectiveTransform", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__posterize__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var bitsPerChannel = 0; + var affectAlpha = false; + + result = vision.Vision.posterize(image, bitsPerChannel, affectAlpha); + } catch (e) { + + } + + return { + testName: "vision.Vision.posterize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__pixelate__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var averagePixels = false; + var pixelSize = 0; + var affectAlpha = false; + + result = vision.Vision.pixelate(image, averagePixels, pixelSize, affectAlpha); + } catch (e) { + + } + + return { + testName: "vision.Vision.pixelate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__pincushionDistortion__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + + result = vision.Vision.pincushionDistortion(image, strength); + } catch (e) { + + } + + return { + testName: "vision.Vision.pincushionDistortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__perwittEdgeDiffOperator__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.perwittEdgeDiffOperator(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.perwittEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__perwittEdgeDetection__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var threshold = 0.0; + + result = vision.Vision.perwittEdgeDetection(image, threshold); + } catch (e) { + + } + + return { + testName: "vision.Vision.perwittEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__normalize__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var rangeStart:Color = null; + var rangeEnd:Color = null; + + result = vision.Vision.normalize(image, rangeStart, rangeEnd); + } catch (e) { + + } + + return { + testName: "vision.Vision.normalize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__nearestNeighborBlur__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var iterations = 0; + + result = vision.Vision.nearestNeighborBlur(image, iterations); + } catch (e) { + + } + + return { + testName: "vision.Vision.nearestNeighborBlur", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__mustacheDistortion__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var amplitude = 0.0; + + result = vision.Vision.mustacheDistortion(image, amplitude); + } catch (e) { + + } + + return { + testName: "vision.Vision.mustacheDistortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__medianBlur__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var kernelSize = 0; + + result = vision.Vision.medianBlur(image, kernelSize); + } catch (e) { + + } + + return { + testName: "vision.Vision.medianBlur", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__limitColorRanges__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var rangeStart:Color = null; + var rangeEnd:Color = null; + + result = vision.Vision.limitColorRanges(image, rangeStart, rangeEnd); + } catch (e) { + + } + + return { + testName: "vision.Vision.limitColorRanges", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__laplacianOfGaussianEdgeDetection__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var threshold = 0; + var filterPositive = false; + var sigma = 0.0; + var kernelSize:GaussianKernelSize = null; + + result = vision.Vision.laplacianOfGaussianEdgeDetection(image, threshold, filterPositive, sigma, kernelSize); + } catch (e) { + + } + + return { + testName: "vision.Vision.laplacianOfGaussianEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__laplacianEdgeDiffOperator__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var filterPositive = false; + + result = vision.Vision.laplacianEdgeDiffOperator(image, filterPositive); + } catch (e) { + + } + + return { + testName: "vision.Vision.laplacianEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__kmeansPosterize__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var maxColorCount = 0; + + result = vision.Vision.kmeansPosterize(image, maxColorCount); + } catch (e) { + + } + + return { + testName: "vision.Vision.kmeansPosterize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__invert__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.invert(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.invert", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__grayscale__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var simpleGrayscale = false; + + result = vision.Vision.grayscale(image, simpleGrayscale); + } catch (e) { + + } + + return { + testName: "vision.Vision.grayscale", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__gaussianBlur__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var sigma = 0.0; + var kernelSize:GaussianKernelSize = null; + var fast = false; + + result = vision.Vision.gaussianBlur(image, sigma, kernelSize, fast); + } catch (e) { + + } + + return { + testName: "vision.Vision.gaussianBlur", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__fisheyeDistortion__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + + result = vision.Vision.fisheyeDistortion(image, strength); + } catch (e) { + + } + + return { + testName: "vision.Vision.fisheyeDistortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__filterForColorChannel__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var channel:ColorChannel = null; + + result = vision.Vision.filterForColorChannel(image, channel); + } catch (e) { + + } + + return { + testName: "vision.Vision.filterForColorChannel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__erode__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var erosionRadius = 0; + var colorImportanceOrder:ColorImportanceOrder = null; + var circularKernel = false; + + result = vision.Vision.erode(image, erosionRadius, colorImportanceOrder, circularKernel); + } catch (e) { + + } + + return { + testName: "vision.Vision.erode", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__dropOutNoise__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var percentage = 0.0; + var threshold = 0; + + result = vision.Vision.dropOutNoise(image, percentage, threshold); + } catch (e) { + + } + + return { + testName: "vision.Vision.dropOutNoise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__dilate__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var dilationRadius = 0; + var colorImportanceOrder:ColorImportanceOrder = null; + var circularKernel = false; + + result = vision.Vision.dilate(image, dilationRadius, colorImportanceOrder, circularKernel); + } catch (e) { + + } + + return { + testName: "vision.Vision.dilate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__deepfry__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var iterations = 0; + + result = vision.Vision.deepfry(image, iterations); + } catch (e) { + + } + + return { + testName: "vision.Vision.deepfry", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__convolve__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var kernel:EitherType>> = null; + + result = vision.Vision.convolve(image, kernel); + } catch (e) { + + } + + return { + testName: "vision.Vision.convolve", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__convolutionRidgeDetection__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var normalizationRangeStart:Color = null; + var normalizationRangeEnd:Color = null; + var refine = false; + + result = vision.Vision.convolutionRidgeDetection(image, normalizationRangeStart, normalizationRangeEnd, refine); + } catch (e) { + + } + + return { + testName: "vision.Vision.convolutionRidgeDetection", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__contrast__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + + result = vision.Vision.contrast(image); + } catch (e) { + + } + + return { + testName: "vision.Vision.contrast", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__combine__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var with = new vision.ds.Image(100, 100); + var percentage = 0.0; + + result = vision.Vision.combine(image, with, percentage); + } catch (e) { + + } + + return { + testName: "vision.Vision.combine", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__cannyEdgeDetection__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var sigma = 0.0; + var kernelSize:GaussianKernelSize = null; + var lowThreshold = 0.0; + var highThreshold = 0.0; + + result = vision.Vision.cannyEdgeDetection(image, sigma, kernelSize, lowThreshold, highThreshold); + } catch (e) { + + } + + return { + testName: "vision.Vision.cannyEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__blackAndWhite__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var threshold = 0; + + result = vision.Vision.blackAndWhite(image, threshold); + } catch (e) { + + } + + return { + testName: "vision.Vision.blackAndWhite", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__bilateralDenoise__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var gaussianSigma = 0.0; + var intensitySigma = 0.0; + + result = vision.Vision.bilateralDenoise(image, gaussianSigma, intensitySigma); + } catch (e) { + + } + + return { + testName: "vision.Vision.bilateralDenoise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__barrelDistortion__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var strength = 0.0; + + result = vision.Vision.barrelDistortion(image, strength); + } catch (e) { + + } + + return { + testName: "vision.Vision.barrelDistortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__affineTransform__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var matrix:TransformationMatrix2D = null; + var expansionMode:ImageExpansionMode = null; + var originPoint = new vision.ds.Point2D(0, 0); + var originMode:TransformationMatrixOrigination = null; + + result = vision.Vision.affineTransform(image, matrix, expansionMode, originPoint, originMode); + } catch (e) { + + } + + return { + testName: "vision.Vision.affineTransform", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static var tests = [ + vision_Vision__whiteNoise__ShouldWork, + vision_Vision__vignette__ShouldWork, + vision_Vision__tint__ShouldWork, + vision_Vision__sobelEdgeDiffOperator__ShouldWork, + vision_Vision__sobelEdgeDetection__ShouldWork, + vision_Vision__smooth__ShouldWork, + vision_Vision__simpleImageSimilarity__ShouldWork, + vision_Vision__sharpen__ShouldWork, + vision_Vision__sepia__ShouldWork, + vision_Vision__saltAndPepperNoise__ShouldWork, + vision_Vision__robertEdgeDiffOperator__ShouldWork, + vision_Vision__replaceColorRanges__ShouldWork, + vision_Vision__projectiveTransform__ShouldWork, + vision_Vision__posterize__ShouldWork, + vision_Vision__pixelate__ShouldWork, + vision_Vision__pincushionDistortion__ShouldWork, + vision_Vision__perwittEdgeDiffOperator__ShouldWork, + vision_Vision__perwittEdgeDetection__ShouldWork, + vision_Vision__normalize__ShouldWork, + vision_Vision__nearestNeighborBlur__ShouldWork, + vision_Vision__mustacheDistortion__ShouldWork, + vision_Vision__medianBlur__ShouldWork, + vision_Vision__limitColorRanges__ShouldWork, + vision_Vision__laplacianOfGaussianEdgeDetection__ShouldWork, + vision_Vision__laplacianEdgeDiffOperator__ShouldWork, + vision_Vision__kmeansPosterize__ShouldWork, + vision_Vision__invert__ShouldWork, + vision_Vision__grayscale__ShouldWork, + vision_Vision__gaussianBlur__ShouldWork, + vision_Vision__fisheyeDistortion__ShouldWork, + vision_Vision__filterForColorChannel__ShouldWork, + vision_Vision__erode__ShouldWork, + vision_Vision__dropOutNoise__ShouldWork, + vision_Vision__dilate__ShouldWork, + vision_Vision__deepfry__ShouldWork, + vision_Vision__convolve__ShouldWork, + vision_Vision__convolutionRidgeDetection__ShouldWork, + vision_Vision__contrast__ShouldWork, + vision_Vision__combine__ShouldWork, + vision_Vision__cannyEdgeDetection__ShouldWork, + vision_Vision__blackAndWhite__ShouldWork, + vision_Vision__bilateralDenoise__ShouldWork, + vision_Vision__barrelDistortion__ShouldWork, + vision_Vision__affineTransform__ShouldWork]; +} \ No newline at end of file diff --git a/tests/generator/Generator.hx b/tests/generator/Generator.hx index 0430eaa8..f9b9f068 100644 --- a/tests/generator/Generator.hx +++ b/tests/generator/Generator.hx @@ -34,7 +34,10 @@ class Generator { packageName: detections.packageName, className: detections.className, fieldName: field, - testGoal: "ShouldWork" + testGoal: "ShouldWork", + parameters: extractParameters(""), + constructorParameters: extractParameters(""), + })); } @@ -44,6 +47,7 @@ class Generator { className: detections.className, fieldName: field, testGoal: "ShouldWork", + parameters: extractParameters(""), constructorParameters: extractParameters(detections.constructorParameters[0] ?? "") })); } @@ -54,7 +58,8 @@ class Generator { className: detections.className, fieldName: method, testGoal: "ShouldWork", - parameters: extractParameters(parameters) + parameters: extractParameters(parameters), + constructorParameters: extractParameters("") })); } @@ -91,15 +96,15 @@ class Generator { static function generateTest(template:String, testBase:TestBase):String { var cleanPackage = testBase.packageName.replace(".", "_") + '_${testBase.className}'; - testBase.parameters ??= ""; - testBase.constructorParameters ??= ""; return template .replace("X1", cleanPackage) .replace("X2", testBase.fieldName) .replace("X3", testBase.testGoal) .replace("X4", '${testBase.packageName}.${testBase.className}') - .replace("X5", testBase.parameters) - .replace("X6", testBase.constructorParameters) + "\n\n"; + .replace("X5", testBase.parameters.injection) + .replace("X6", testBase.constructorParameters.injection) + .replace("X7", testBase.parameters.declarations) + .replace("X8", testBase.constructorParameters.declarations) + "\n\n"; } @@ -125,16 +130,38 @@ class Generator { } - static function extractParameters(parameters:String):String { - var regex = ~/\w+:((?:\w|\.)+|\{.+\},?)/; - var parameterList = []; + static function extractParameters(parameters:String):{declarations:String, injection:String} { + var regex = ~/(\w+):((?:EitherType<.+, .+>,?)|(?:\w+<\{.+\}>,?)|(?:\w|\.)+|\{.+\},?)/; + var output = {declarations: "", injection: []} while (regex.match(parameters)) { - var type = regex.matched(1); + var name = regex.matched(1); + var type = regex.matched(2); parameters = regex.matchedRight(); - parameterList.push('(null : $type)'); + output.declarations += 'var $name${getDefaultValueOf(type) == "null" ? ':$type' : ""} = ${getDefaultValueOf(type)};\n\t\t\t'; + output.injection.push(name); } - return parameterList.join(", "); + return { + declarations: output.declarations, + injection: output.injection.join(", ") + }; + } + + static function getDefaultValueOf(valueType:String) { + return switch valueType { + case "String": '""'; + case "Int": "0"; + case "Float": "0.0"; + case "Bool": "false"; + case "Array" | "Map": "[]"; + case "Point2D" | "IntPoint2D" | "Int16Point2D" | "UInt16Point2D": 'new vision.ds.$valueType(0, 0)'; + case "Line2D": 'new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10})'; + case "Ray2D": 'new vision.ds.Ray2D({x: 0, y: 0}, 1)'; + case "ByteArray": 'vision.ds.ByteArray.from(0)'; + case "Image": 'new vision.ds.Image(100, 100)'; + case "T": "0"; // A little insane but should work in most cases so idk + default: "null"; + } } } @@ -143,6 +170,6 @@ typedef TestBase = { className:String, fieldName:String, testGoal:String, - ?parameters:String, - ?constructorParameters:String + ?parameters:{declarations:String, injection:String}, + ?constructorParameters:{declarations:String, injection:String} } \ No newline at end of file diff --git a/tests/generator/Main.hx b/tests/generator/Main.hx index ee977f64..4b867338 100644 --- a/tests/generator/Main.hx +++ b/tests/generator/Main.hx @@ -53,6 +53,10 @@ class Main { Sys.println("Job Done! Use this array to test the classes:"); Sys.println(' [${resultingClassArray.join(", ")}]'); + if (config.testsToRunFile.length > 0) { + Sys.println("Found tests-to-run file! writing test cases there as well..."); + File.saveContent(FileSystem.absolutePath(config.testsToRunFile), 'package;\n\nimport tests.*;\n\nfinal tests:Array> = [\n\t${resultingClassArray.join(", \n\t")}\n];'); + } } static function readFileStructure(from:String):Array { diff --git a/tests/generator/templates/InstanceFieldTestTemplate.hx b/tests/generator/templates/InstanceFieldTestTemplate.hx index 07a4b55b..3368edbe 100644 --- a/tests/generator/templates/InstanceFieldTestTemplate.hx +++ b/tests/generator/templates/InstanceFieldTestTemplate.hx @@ -1,6 +1,7 @@ public static function X1__X2__X3():TestResult { var result = null; try { + X8 var object = new X4(X6); result = object.X2; } catch (e) { diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx index 3caa2539..06fdf4e8 100644 --- a/tests/generator/templates/InstanceFunctionTestTemplate.hx +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -1,6 +1,8 @@ public static function X1__X2__X3():TestResult { var result = null; try { + X8 + X7 var object = new X4(X6); result = object.X2(X5); } catch (e) { diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx index 293e7f8b..eb6d9059 100644 --- a/tests/generator/templates/StaticFunctionTestTemplate.hx +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -1,6 +1,7 @@ public static function X1__X2__X3():TestResult { var result = null; try { + X7 result = X4.X2(X5); } catch (e) { diff --git a/tests/generator/templates/TestClassHeader.hx b/tests/generator/templates/TestClassHeader.hx index 08f1c765..3c645029 100644 --- a/tests/generator/templates/TestClassHeader.hx +++ b/tests/generator/templates/TestClassHeader.hx @@ -6,4 +6,5 @@ import TestStatus; import PACKAGE_NAME.CLASS_NAME; ADDITIONAL_IMPORTS +@:access(PACKAGE_NAME.CLASS_NAME) class CLASS_NAMETests { diff --git a/tests/generator/templates/doc.hx b/tests/generator/templates/doc.hx index 90af1042..7efbd7df 100644 --- a/tests/generator/templates/doc.hx +++ b/tests/generator/templates/doc.hx @@ -7,5 +7,7 @@ package templates; `X4` - class name, including full package, for example: `my.example.ClassInstance` `X5` - optional - parameter list for when we test a function `X6` - optional - parameter list for when we test a constructor + `X7` - optional - when providing `X5`, an instantiation of said params + `X8` - optional - when providing `X6`, an instantiation of said params **/ public var doc:String; From 60abe5b1e3e79bc21f64643d6a46a2fc68ed246c Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Thu, 5 Jun 2025 16:42:56 +0300 Subject: [PATCH 21/32] formatting changes to output files + better generator --- tests/config.json | 3 +- tests/generated/src/Main.hx | 4 +- tests/generated/src/TestsToRun.hx | 1 - tests/generated/src/tests/ArrayToolsTests.hx | 79 +- .../src/tests/BilateralFilterTests.hx | 3 +- .../src/tests/BilinearInterpolationTests.hx | 4 +- tests/generated/src/tests/CannyObjectTests.hx | 2 +- tests/generated/src/tests/CannyTests.hx | 7 +- .../generated/src/tests/ColorClusterTests.hx | 2 +- tests/generated/src/tests/ColorTests.hx | 1093 +++++++++++++++-- tests/generated/src/tests/CramerTests.hx | 2 +- .../src/tests/FormatImageExporterTests.hx | 5 +- .../src/tests/FormatImageLoaderTests.hx | 4 +- tests/generated/src/tests/GaussJordanTests.hx | 83 +- tests/generated/src/tests/GaussTests.hx | 4 +- tests/generated/src/tests/HistogramTests.hx | 6 +- .../generated/src/tests/ImageHashingTests.hx | 4 +- tests/generated/src/tests/ImageIOTests.hx | 2 +- .../generated/src/tests/Int16Point2DTests.hx | 8 +- tests/generated/src/tests/IntPoint2DTests.hx | 11 +- tests/generated/src/tests/KMeansTests.hx | 2 +- tests/generated/src/tests/LaplaceTests.hx | 4 +- tests/generated/src/tests/Line2DTests.hx | 9 +- tests/generated/src/tests/MathToolsTests.hx | 200 +-- .../src/tests/PerspectiveWarpTests.hx | 3 +- tests/generated/src/tests/PerwittTests.hx | 4 +- tests/generated/src/tests/PixelTests.hx | 2 +- tests/generated/src/tests/Point2DTests.hx | 7 +- tests/generated/src/tests/Point3DTests.hx | 5 +- .../src/tests/PointTransformationPairTests.hx | 2 +- tests/generated/src/tests/QueueTests.hx | 7 +- tests/generated/src/tests/RadixTests.hx | 20 +- tests/generated/src/tests/Ray2DTests.hx | 9 +- tests/generated/src/tests/RectangleTests.hx | 2 +- .../generated/src/tests/RobertsCrossTests.hx | 3 +- tests/generated/src/tests/SimpleHoughTests.hx | 3 +- .../src/tests/SimpleLineDetectorTests.hx | 23 +- tests/generated/src/tests/SobelTests.hx | 4 +- .../generated/src/tests/UInt16Point2DTests.hx | 8 +- tests/generated/src/tests/VisionTests.hx | 48 +- tests/generator/Detector.hx | 6 +- tests/generator/Generator.hx | 13 +- 42 files changed, 1341 insertions(+), 370 deletions(-) diff --git a/tests/config.json b/tests/config.json index cb4114e5..7e25db22 100644 --- a/tests/config.json +++ b/tests/config.json @@ -13,7 +13,8 @@ "FrameworkImageIO.hx", "ByteArray.hx", "QueueCell.hx", - "Array2D.hx" + "Array2D.hx", + "GaussJordan.hx" ], "destination": "./generated/src/tests", "testsToRunFile": "./generated/src/TestsToRun.hx" diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index f1eaae96..1ae77065 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -38,7 +38,7 @@ class Main { } for (cls in TestsToRun.tests) { - var testFunctions:Array<() -> TestResult> = Reflect.field(cls, "tests"); + var testFunctions:Array<() -> TestResult> = Type.getClassFields(cls).map(func -> Reflect.field(cls, func)); for (func in testFunctions) { i++; var result:TestResult = func(); @@ -61,7 +61,7 @@ class Main { Sys.println('$RED$BOLD Final Test Status:$RESET'); Sys.println(' - $RESET$BOLD${getTestPassColor(Success)} ${conclusionMap.get(Success).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Success)} Passed 🥳$RESET'); Sys.println(' - $RESET$BOLD${getTestPassColor(Failure)} ${conclusionMap.get(Failure).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Failure)} Failed 🥺$RESET'); - Sys.println(' - $RESET$BOLD${getTestPassColor(Skipped)} ${conclusionMap.get(Skipped).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Skipped)} Skipped 🤷‍♀️$RESET'); + Sys.println(' - $RESET$BOLD${getTestPassColor(Skipped)} ${conclusionMap.get(Skipped).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Skipped)} Skipped 🤷$RESET'); Sys.println(' - $RESET$BOLD${getTestPassColor(Unimplemented)} ${conclusionMap.get(Unimplemented).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Unimplemented)} Unimplemented 😬$RESET'); } } diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index 43d71c88..f9ff7ee7 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -8,7 +8,6 @@ final tests:Array> = [ CannyTests, CramerTests, GaussTests, - GaussJordanTests, ImageHashingTests, KMeansTests, LaplaceTests, diff --git a/tests/generated/src/tests/ArrayToolsTests.hx b/tests/generated/src/tests/ArrayToolsTests.hx index 6ba942f2..d74020e7 100644 --- a/tests/generated/src/tests/ArrayToolsTests.hx +++ b/tests/generated/src/tests/ArrayToolsTests.hx @@ -12,6 +12,25 @@ import vision.tools.MathTools.*; @:access(vision.tools.ArrayTools) class ArrayToolsTests { + public static function vision_tools_ArrayTools__min__ShouldWork():TestResult { + var result = null; + try { + var values = []; + var valueFunction = (_) -> null; + + result = vision.tools.ArrayTools.min(values, valueFunction); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.min", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_tools_ArrayTools__median__ShouldWork():TestResult { var result = null; try { @@ -30,6 +49,62 @@ class ArrayToolsTests { } } - public static var tests = [ - vision_tools_ArrayTools__median__ShouldWork]; + public static function vision_tools_ArrayTools__max__ShouldWork():TestResult { + var result = null; + try { + var values = []; + var valueFunction = (_) -> null; + + result = vision.tools.ArrayTools.max(values, valueFunction); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.max", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__distanceTo__ShouldWork():TestResult { + var result = null; + try { + var array = []; + var to = []; + var distanceFunction = (_, _) -> null; + + result = vision.tools.ArrayTools.distanceTo(array, to, distanceFunction); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__average__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.average(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.average", + returned: result, + expected: null, + status: Unimplemented + } + } + + } \ No newline at end of file diff --git a/tests/generated/src/tests/BilateralFilterTests.hx b/tests/generated/src/tests/BilateralFilterTests.hx index 7330e4e2..4659c08a 100644 --- a/tests/generated/src/tests/BilateralFilterTests.hx +++ b/tests/generated/src/tests/BilateralFilterTests.hx @@ -31,6 +31,5 @@ class BilateralFilterTests { } } - public static var tests = [ - vision_algorithms_BilateralFilter__filter__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/BilinearInterpolationTests.hx b/tests/generated/src/tests/BilinearInterpolationTests.hx index c2ba5dce..25d67f37 100644 --- a/tests/generated/src/tests/BilinearInterpolationTests.hx +++ b/tests/generated/src/tests/BilinearInterpolationTests.hx @@ -54,7 +54,5 @@ class BilinearInterpolationTests { } } - public static var tests = [ - vision_algorithms_BilinearInterpolation__interpolateMissingPixels__ShouldWork, - vision_algorithms_BilinearInterpolation__interpolate__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/CannyObjectTests.hx b/tests/generated/src/tests/CannyObjectTests.hx index 58b6d53d..0ae9cd98 100644 --- a/tests/generated/src/tests/CannyObjectTests.hx +++ b/tests/generated/src/tests/CannyObjectTests.hx @@ -8,5 +8,5 @@ import vision.ds.canny.CannyObject; @:access(vision.ds.canny.CannyObject) class CannyObjectTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/CannyTests.hx b/tests/generated/src/tests/CannyTests.hx index 685c2ece..05172615 100644 --- a/tests/generated/src/tests/CannyTests.hx +++ b/tests/generated/src/tests/CannyTests.hx @@ -104,10 +104,5 @@ class CannyTests { } } - public static var tests = [ - vision_algorithms_Canny__nonMaxSuppression__ShouldWork, - vision_algorithms_Canny__grayscale__ShouldWork, - vision_algorithms_Canny__applySobelFilters__ShouldWork, - vision_algorithms_Canny__applyHysteresis__ShouldWork, - vision_algorithms_Canny__applyGaussian__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/ColorClusterTests.hx b/tests/generated/src/tests/ColorClusterTests.hx index dad1b073..b2cc2dfd 100644 --- a/tests/generated/src/tests/ColorClusterTests.hx +++ b/tests/generated/src/tests/ColorClusterTests.hx @@ -8,5 +8,5 @@ import vision.ds.kmeans.ColorCluster; @:access(vision.ds.kmeans.ColorCluster) class ColorClusterTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index 7241a77d..02b9a609 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -409,238 +409,1150 @@ class ColorTests { } } + public static function vision_ds_Color__int_not_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_not_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_not_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_less_than_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_less_than_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_less_than_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_less_than_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_less_than_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_less_than_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_greater_than_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_greater_than_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_greater_than_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_greater_than_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_greater_than_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_greater_than_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_xor_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_xor_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_xor_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_unsigned_right_shift_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_unsigned_right_shift_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_unsigned_right_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_right_shift_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_right_shift_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_right_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_or_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_or_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_or_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_left_shift_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_left_shift_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_left_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__int_bitwise_and_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0; + var rhs:Color = null; + + result = vision.ds.Color.int_bitwise_and_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.int_bitwise_and_color", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_ds_Color__getAverage__ShouldWork():TestResult { var result = null; try { - var fromColors = []; - var considerTransparency = false; + var fromColors = []; + var considerTransparency = false; + + result = vision.ds.Color.getAverage(fromColors, considerTransparency); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.getAverage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromRGBAFloat__ShouldWork():TestResult { + var result = null; + try { + var Red = 0.0; + var Green = 0.0; + var Blue = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromRGBAFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromRGBA__ShouldWork():TestResult { + var result = null; + try { + var Red = 0; + var Green = 0; + var Blue = 0; + var Alpha = 0; + + result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromRGBA", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromInt__ShouldWork():TestResult { + var result = null; + try { + var value = 0; + + result = vision.ds.Color.fromInt(value); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromInt", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromHSL__ShouldWork():TestResult { + var result = null; + try { + var Hue = 0.0; + var Saturation = 0.0; + var Lightness = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromHSL", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromHSB__ShouldWork():TestResult { + var result = null; + try { + var Hue = 0.0; + var Saturation = 0.0; + var Brightness = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromHSB", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromFloat__ShouldWork():TestResult { + var result = null; + try { + var Value = 0.0; + + result = vision.ds.Color.fromFloat(Value); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromFloat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__fromCMYK__ShouldWork():TestResult { + var result = null; + try { + var Cyan = 0.0; + var Magenta = 0.0; + var Yellow = 0.0; + var Black = 0.0; + var Alpha = 0.0; + + result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.fromCMYK", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__from8Bit__ShouldWork():TestResult { + var result = null; + try { + var Value = 0; + + result = vision.ds.Color.from8Bit(Value); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.from8Bit", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_not_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_not_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_not_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_less_than_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_less_than_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_less_than_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_less_than_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_less_than_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_less_than_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_greater_than_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_greater_than_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_greater_than_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_greater_than_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_greater_than_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_greater_than_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__float_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs = 0.0; + var rhs:Color = null; + + result = vision.ds.Color.float_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.float_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__divide__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.divide(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.divide", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__distanceBetween__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + var considerTransparency = false; + + result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.distanceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__differenceBetween__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + var considerTransparency = false; + + result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.differenceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_not_equal_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_not_equal_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_not_equal_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_not_equal_float__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0.0; + + result = vision.ds.Color.color_not_equal_float(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_not_equal_float", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_not_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.color_not_equal_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_not_equal_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_less_than_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_less_than_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_less_than_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_less_than_float__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0.0; + + result = vision.ds.Color.color_less_than_float(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_less_than_float", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_less_than_equal_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_less_than_equal_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_less_than_equal_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_less_than_equal_float__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0.0; + + result = vision.ds.Color.color_less_than_equal_float(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_less_than_equal_float", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_less_than_equal_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; - result = vision.ds.Color.getAverage(fromColors, considerTransparency); + result = vision.ds.Color.color_less_than_equal_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.getAverage", + testName: "vision.ds.Color.color_less_than_equal_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromRGBAFloat__ShouldWork():TestResult { + public static function vision_ds_Color__color_less_than_color__ShouldWork():TestResult { var result = null; try { - var Red = 0.0; - var Green = 0.0; - var Blue = 0.0; - var Alpha = 0.0; + var lhs:Color = null; + var rhs:Color = null; - result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); + result = vision.ds.Color.color_less_than_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromRGBAFloat", + testName: "vision.ds.Color.color_less_than_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromRGBA__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_int__ShouldWork():TestResult { var result = null; try { - var Red = 0; - var Green = 0; - var Blue = 0; - var Alpha = 0; + var lhs:Color = null; + var rhs = 0; - result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); + result = vision.ds.Color.color_greater_than_int(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromRGBA", + testName: "vision.ds.Color.color_greater_than_int", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromInt__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_float__ShouldWork():TestResult { var result = null; try { - var value = 0; + var lhs:Color = null; + var rhs = 0.0; - result = vision.ds.Color.fromInt(value); + result = vision.ds.Color.color_greater_than_float(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromInt", + testName: "vision.ds.Color.color_greater_than_float", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromHSL__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_equal_int__ShouldWork():TestResult { var result = null; try { - var Hue = 0.0; - var Saturation = 0.0; - var Lightness = 0.0; - var Alpha = 0.0; + var lhs:Color = null; + var rhs = 0; - result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); + result = vision.ds.Color.color_greater_than_equal_int(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromHSL", + testName: "vision.ds.Color.color_greater_than_equal_int", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromHSB__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_equal_float__ShouldWork():TestResult { var result = null; try { - var Hue = 0.0; - var Saturation = 0.0; - var Brightness = 0.0; - var Alpha = 0.0; + var lhs:Color = null; + var rhs = 0.0; - result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); + result = vision.ds.Color.color_greater_than_equal_float(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromHSB", + testName: "vision.ds.Color.color_greater_than_equal_float", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromFloat__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_equal_color__ShouldWork():TestResult { var result = null; try { - var Value = 0.0; + var lhs:Color = null; + var rhs:Color = null; - result = vision.ds.Color.fromFloat(Value); + result = vision.ds.Color.color_greater_than_equal_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromFloat", + testName: "vision.ds.Color.color_greater_than_equal_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__fromCMYK__ShouldWork():TestResult { + public static function vision_ds_Color__color_greater_than_color__ShouldWork():TestResult { var result = null; try { - var Cyan = 0.0; - var Magenta = 0.0; - var Yellow = 0.0; - var Black = 0.0; - var Alpha = 0.0; + var lhs:Color = null; + var rhs:Color = null; - result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); + result = vision.ds.Color.color_greater_than_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.fromCMYK", + testName: "vision.ds.Color.color_greater_than_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__from8Bit__ShouldWork():TestResult { + public static function vision_ds_Color__color_equal_int__ShouldWork():TestResult { var result = null; try { - var Value = 0; + var lhs:Color = null; + var rhs = 0; - result = vision.ds.Color.from8Bit(Value); + result = vision.ds.Color.color_equal_int(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.from8Bit", + testName: "vision.ds.Color.color_equal_int", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__divide__ShouldWork():TestResult { + public static function vision_ds_Color__color_equal_float__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0.0; + + result = vision.ds.Color.color_equal_float(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_equal_float", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_equal_color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.divide(lhs, rhs); + result = vision.ds.Color.color_equal_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.divide", + testName: "vision.ds.Color.color_equal_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__distanceBetween__ShouldWork():TestResult { + public static function vision_ds_Color__color_bitwise_xor_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_xor_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_xor_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_xor_color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - var considerTransparency = false; - result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); + result = vision.ds.Color.color_bitwise_xor_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.distanceBetween", + testName: "vision.ds.Color.color_bitwise_xor_color", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__differenceBetween__ShouldWork():TestResult { + public static function vision_ds_Color__color_bitwise_unsigned_right_shift_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_unsigned_right_shift_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_unsigned_right_shift_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_unsigned_right_shift_color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - var considerTransparency = false; - result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); + result = vision.ds.Color.color_bitwise_unsigned_right_shift_color(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.differenceBetween", + testName: "vision.ds.Color.color_bitwise_unsigned_right_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_right_shift_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_right_shift_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_right_shift_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_right_shift_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.color_bitwise_right_shift_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_right_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_or_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_or_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_or_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_or_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.color_bitwise_or_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_or_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_left_shift_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_left_shift_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_left_shift_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_left_shift_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.color_bitwise_left_shift_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_left_shift_color", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_and_int__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs = 0; + + result = vision.ds.Color.color_bitwise_and_int(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_and_int", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Color__color_bitwise_and_color__ShouldWork():TestResult { + var result = null; + try { + var lhs:Color = null; + var rhs:Color = null; + + result = vision.ds.Color.color_bitwise_and_color(lhs, rhs); + } catch (e) { + + } + + return { + testName: "vision.ds.Color.color_bitwise_and_color", returned: result, expected: null, status: Unimplemented @@ -1075,58 +1987,5 @@ class ColorTests { } } - public static var tests = [ - vision_ds_Color__subtract__ShouldWork, - vision_ds_Color__multiply__ShouldWork, - vision_ds_Color__makeRandom__ShouldWork, - vision_ds_Color__interpolate__ShouldWork, - vision_ds_Color__getAverage__ShouldWork, - vision_ds_Color__fromRGBAFloat__ShouldWork, - vision_ds_Color__fromRGBA__ShouldWork, - vision_ds_Color__fromInt__ShouldWork, - vision_ds_Color__fromHSL__ShouldWork, - vision_ds_Color__fromHSB__ShouldWork, - vision_ds_Color__fromFloat__ShouldWork, - vision_ds_Color__fromCMYK__ShouldWork, - vision_ds_Color__from8Bit__ShouldWork, - vision_ds_Color__divide__ShouldWork, - vision_ds_Color__distanceBetween__ShouldWork, - vision_ds_Color__differenceBetween__ShouldWork, - vision_ds_Color__add__ShouldWork, - vision_ds_Color__toWebString__ShouldWork, - vision_ds_Color__toString__ShouldWork, - vision_ds_Color__toInt__ShouldWork, - vision_ds_Color__toHexString__ShouldWork, - vision_ds_Color__to24Bit__ShouldWork, - vision_ds_Color__setRGBAFloat__ShouldWork, - vision_ds_Color__setRGBA__ShouldWork, - vision_ds_Color__setHSL__ShouldWork, - vision_ds_Color__setHSB__ShouldWork, - vision_ds_Color__setCMYK__ShouldWork, - vision_ds_Color__lighten__ShouldWork, - vision_ds_Color__invert__ShouldWork, - vision_ds_Color__grayscale__ShouldWork, - vision_ds_Color__getTriadicHarmony__ShouldWork, - vision_ds_Color__getSplitComplementHarmony__ShouldWork, - vision_ds_Color__getComplementHarmony__ShouldWork, - vision_ds_Color__getAnalogousHarmony__ShouldWork, - vision_ds_Color__darken__ShouldWork, - vision_ds_Color__blackOrWhite__ShouldWork, - vision_ds_Color__red__ShouldWork, - vision_ds_Color__blue__ShouldWork, - vision_ds_Color__green__ShouldWork, - vision_ds_Color__alpha__ShouldWork, - vision_ds_Color__redFloat__ShouldWork, - vision_ds_Color__blueFloat__ShouldWork, - vision_ds_Color__greenFloat__ShouldWork, - vision_ds_Color__alphaFloat__ShouldWork, - vision_ds_Color__cyan__ShouldWork, - vision_ds_Color__magenta__ShouldWork, - vision_ds_Color__yellow__ShouldWork, - vision_ds_Color__black__ShouldWork, - vision_ds_Color__rgb__ShouldWork, - vision_ds_Color__hue__ShouldWork, - vision_ds_Color__saturation__ShouldWork, - vision_ds_Color__brightness__ShouldWork, - vision_ds_Color__lightness__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/CramerTests.hx b/tests/generated/src/tests/CramerTests.hx index b122460b..c7b21a43 100644 --- a/tests/generated/src/tests/CramerTests.hx +++ b/tests/generated/src/tests/CramerTests.hx @@ -13,5 +13,5 @@ import vision.ds.Array2D; @:access(vision.algorithms.Cramer) class CramerTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageExporterTests.hx b/tests/generated/src/tests/FormatImageExporterTests.hx index 370dc426..9d420960 100644 --- a/tests/generated/src/tests/FormatImageExporterTests.hx +++ b/tests/generated/src/tests/FormatImageExporterTests.hx @@ -73,8 +73,5 @@ class FormatImageExporterTests { } } - public static var tests = [ - vision_formats___internal_FormatImageExporter__png__ShouldWork, - vision_formats___internal_FormatImageExporter__jpeg__ShouldWork, - vision_formats___internal_FormatImageExporter__bmp__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageLoaderTests.hx b/tests/generated/src/tests/FormatImageLoaderTests.hx index 7dd0fdb9..a994788c 100644 --- a/tests/generated/src/tests/FormatImageLoaderTests.hx +++ b/tests/generated/src/tests/FormatImageLoaderTests.hx @@ -51,7 +51,5 @@ class FormatImageLoaderTests { } } - public static var tests = [ - vision_formats___internal_FormatImageLoader__png__ShouldWork, - vision_formats___internal_FormatImageLoader__bmp__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/GaussJordanTests.hx b/tests/generated/src/tests/GaussJordanTests.hx index 0ca95682..cd2acd9a 100644 --- a/tests/generated/src/tests/GaussJordanTests.hx +++ b/tests/generated/src/tests/GaussJordanTests.hx @@ -8,6 +8,26 @@ import vision.ds.Matrix2D; @:access(vision.algorithms.GaussJordan) class GaussJordanTests { + public static function vision_algorithms_GaussJordan__swapRows__ShouldWork():TestResult { + var result = null; + try { + var matrix = []; + var row1 = 0; + var row2 = 0; + + result = vision.algorithms.GaussJordan.swapRows(matrix, row1, row2); + } catch (e) { + + } + + return { + testName: "vision.algorithms.GaussJordan.swapRows", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_algorithms_GaussJordan__invert__ShouldWork():TestResult { var result = null; try { @@ -26,6 +46,67 @@ class GaussJordanTests { } } + public static function vision_algorithms_GaussJordan__extractMatrix__ShouldWork():TestResult { + var result = null; + try { + var matrix:Matrix2D = null; + var rows = 0; + var columns = []; + + result = vision.algorithms.GaussJordan.extractMatrix(matrix, rows, columns); + } catch (e) { + + } + + return { + testName: "vision.algorithms.GaussJordan.extractMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_GaussJordan__createIdentityMatrix__ShouldWork():TestResult { + var result = null; + try { + var size = 0; + + result = vision.algorithms.GaussJordan.createIdentityMatrix(size); + } catch (e) { + + } + + return { + testName: "vision.algorithms.GaussJordan.createIdentityMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_GaussJordan__augmentMatrix__ShouldWork():TestResult { + var result = null; + try { + var matrix = []; + var augmentation = []; + + result = vision.algorithms.GaussJordan.augmentMatrix(matrix, augmentation); + } catch (e) { + + } + + return { + testName: "vision.algorithms.GaussJordan.augmentMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } + public static var tests = [ - vision_algorithms_GaussJordan__invert__ShouldWork]; + vision_algorithms_GaussJordan__swapRows__ShouldWork, + vision_algorithms_GaussJordan__invert__ShouldWork, + vision_algorithms_GaussJordan__extractMatrix__ShouldWork, + vision_algorithms_GaussJordan__createIdentityMatrix__ShouldWork, + vision_algorithms_GaussJordan__augmentMatrix__ShouldWork]; } \ No newline at end of file diff --git a/tests/generated/src/tests/GaussTests.hx b/tests/generated/src/tests/GaussTests.hx index 2b46c70b..be353282 100644 --- a/tests/generated/src/tests/GaussTests.hx +++ b/tests/generated/src/tests/GaussTests.hx @@ -50,7 +50,5 @@ class GaussTests { } } - public static var tests = [ - vision_algorithms_Gauss__fastBlur__ShouldWork, - vision_algorithms_Gauss__createKernelOfSize__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/HistogramTests.hx b/tests/generated/src/tests/HistogramTests.hx index 4efd2012..9bd18225 100644 --- a/tests/generated/src/tests/HistogramTests.hx +++ b/tests/generated/src/tests/HistogramTests.hx @@ -84,9 +84,5 @@ class HistogramTests { } } - public static var tests = [ - vision_ds_Histogram__increment__ShouldWork, - vision_ds_Histogram__decrement__ShouldWork, - vision_ds_Histogram__length__ShouldWork, - vision_ds_Histogram__median__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/ImageHashingTests.hx b/tests/generated/src/tests/ImageHashingTests.hx index 4fecea24..0e135b70 100644 --- a/tests/generated/src/tests/ImageHashingTests.hx +++ b/tests/generated/src/tests/ImageHashingTests.hx @@ -50,7 +50,5 @@ class ImageHashingTests { } } - public static var tests = [ - vision_algorithms_ImageHashing__phash__ShouldWork, - vision_algorithms_ImageHashing__ahash__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/ImageIOTests.hx b/tests/generated/src/tests/ImageIOTests.hx index dcafb9a6..a47d3ee8 100644 --- a/tests/generated/src/tests/ImageIOTests.hx +++ b/tests/generated/src/tests/ImageIOTests.hx @@ -9,5 +9,5 @@ import vision.formats.to.To; @:access(vision.formats.ImageIO) class ImageIOTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/Int16Point2DTests.hx b/tests/generated/src/tests/Int16Point2DTests.hx index d9da9d85..cbce9ce8 100644 --- a/tests/generated/src/tests/Int16Point2DTests.hx +++ b/tests/generated/src/tests/Int16Point2DTests.hx @@ -132,11 +132,5 @@ class Int16Point2DTests { } } - public static var tests = [ - vision_ds_Int16Point2D__toString__ShouldWork, - vision_ds_Int16Point2D__toPoint2D__ShouldWork, - vision_ds_Int16Point2D__toIntPoint2D__ShouldWork, - vision_ds_Int16Point2D__toInt__ShouldWork, - vision_ds_Int16Point2D__x__ShouldWork, - vision_ds_Int16Point2D__y__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index ca45e73f..cb671db1 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -197,14 +197,5 @@ class IntPoint2DTests { } } - public static var tests = [ - vision_ds_IntPoint2D__fromPoint2D__ShouldWork, - vision_ds_IntPoint2D__toString__ShouldWork, - vision_ds_IntPoint2D__toPoint2D__ShouldWork, - vision_ds_IntPoint2D__radiansTo__ShouldWork, - vision_ds_IntPoint2D__distanceTo__ShouldWork, - vision_ds_IntPoint2D__degreesTo__ShouldWork, - vision_ds_IntPoint2D__copy__ShouldWork, - vision_ds_IntPoint2D__x__ShouldWork, - vision_ds_IntPoint2D__y__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/KMeansTests.hx b/tests/generated/src/tests/KMeansTests.hx index 9e914818..b46d8260 100644 --- a/tests/generated/src/tests/KMeansTests.hx +++ b/tests/generated/src/tests/KMeansTests.hx @@ -11,5 +11,5 @@ import vision.exceptions.Unimplemented; @:access(vision.algorithms.KMeans) class KMeansTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/LaplaceTests.hx b/tests/generated/src/tests/LaplaceTests.hx index 177154c2..dfc2848d 100644 --- a/tests/generated/src/tests/LaplaceTests.hx +++ b/tests/generated/src/tests/LaplaceTests.hx @@ -52,7 +52,5 @@ class LaplaceTests { } } - public static var tests = [ - vision_algorithms_Laplace__laplacianOfGaussian__ShouldWork, - vision_algorithms_Laplace__convolveWithLaplacianOperator__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/Line2DTests.hx b/tests/generated/src/tests/Line2DTests.hx index 39f868c8..a6dce658 100644 --- a/tests/generated/src/tests/Line2DTests.hx +++ b/tests/generated/src/tests/Line2DTests.hx @@ -152,12 +152,5 @@ class Line2DTests { } } - public static var tests = [ - vision_ds_Line2D__fromRay2D__ShouldWork, - vision_ds_Line2D__toString__ShouldWork, - vision_ds_Line2D__toRay2D__ShouldWork, - vision_ds_Line2D__intersect__ShouldWork, - vision_ds_Line2D__distanceTo__ShouldWork, - vision_ds_Line2D__length__ShouldWork, - vision_ds_Line2D__middle__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index 7ee3a230..edcdc3a8 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -777,6 +777,125 @@ class MathToolsTests { } } + public static function vision_tools_MathTools__get_SQRT3__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_SQRT3(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_SQRT3", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_SQRT2__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_SQRT2(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_SQRT2", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_POSITIVE_INFINITY__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_POSITIVE_INFINITY(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_POSITIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_PI_OVER_2__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_PI_OVER_2(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_PI_OVER_2", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_PI__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_PI(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_PI", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_NaN__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_NaN(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_NaN", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_MathTools__get_NEGATIVE_INFINITY__ShouldWork():TestResult { + var result = null; + try { + + result = vision.tools.MathTools.get_NEGATIVE_INFINITY(); + } catch (e) { + + } + + return { + testName: "vision.tools.MathTools.get_NEGATIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { var result = null; try { @@ -1466,84 +1585,5 @@ class MathToolsTests { } } - public static var tests = [ - vision_tools_MathTools__wrapInt__ShouldWork, - vision_tools_MathTools__wrapFloat__ShouldWork, - vision_tools_MathTools__truncate__ShouldWork, - vision_tools_MathTools__toFloat__ShouldWork, - vision_tools_MathTools__tand__ShouldWork, - vision_tools_MathTools__tan__ShouldWork, - vision_tools_MathTools__sqrt__ShouldWork, - vision_tools_MathTools__slopeToRadians__ShouldWork, - vision_tools_MathTools__slopeToDegrees__ShouldWork, - vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork, - vision_tools_MathTools__sind__ShouldWork, - vision_tools_MathTools__sin__ShouldWork, - vision_tools_MathTools__secd__ShouldWork, - vision_tools_MathTools__sec__ShouldWork, - vision_tools_MathTools__round__ShouldWork, - vision_tools_MathTools__random__ShouldWork, - vision_tools_MathTools__radiansToSlope__ShouldWork, - vision_tools_MathTools__radiansToDegrees__ShouldWork, - vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork, - vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork, - vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork, - vision_tools_MathTools__pow__ShouldWork, - vision_tools_MathTools__parseInt__ShouldWork, - vision_tools_MathTools__parseFloat__ShouldWork, - vision_tools_MathTools__parseBool__ShouldWork, - vision_tools_MathTools__mirrorInsideRectangle__ShouldWork, - vision_tools_MathTools__log__ShouldWork, - vision_tools_MathTools__isNaN__ShouldWork, - vision_tools_MathTools__isInt__ShouldWork, - vision_tools_MathTools__isFinite__ShouldWork, - vision_tools_MathTools__isBetweenRanges__ShouldWork, - vision_tools_MathTools__isBetweenRange__ShouldWork, - vision_tools_MathTools__invertInsideRectangle__ShouldWork, - vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork, - vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork, - vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork, - vision_tools_MathTools__gamma__ShouldWork, - vision_tools_MathTools__fround__ShouldWork, - vision_tools_MathTools__floor__ShouldWork, - vision_tools_MathTools__flipInsideRectangle__ShouldWork, - vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork, - vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork, - vision_tools_MathTools__ffloor__ShouldWork, - vision_tools_MathTools__fceil__ShouldWork, - vision_tools_MathTools__factorial__ShouldWork, - vision_tools_MathTools__exp__ShouldWork, - vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork, - vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork, - vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork, - vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork, - vision_tools_MathTools__distanceBetweenRays2D__ShouldWork, - vision_tools_MathTools__distanceBetweenPoints__ShouldWork, - vision_tools_MathTools__distanceBetweenLines2D__ShouldWork, - vision_tools_MathTools__degreesToSlope__ShouldWork, - vision_tools_MathTools__degreesToRadians__ShouldWork, - vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork, - vision_tools_MathTools__cropDecimal__ShouldWork, - vision_tools_MathTools__cotand__ShouldWork, - vision_tools_MathTools__cotan__ShouldWork, - vision_tools_MathTools__cosecd__ShouldWork, - vision_tools_MathTools__cosec__ShouldWork, - vision_tools_MathTools__cosd__ShouldWork, - vision_tools_MathTools__cos__ShouldWork, - vision_tools_MathTools__clamp__ShouldWork, - vision_tools_MathTools__ceil__ShouldWork, - vision_tools_MathTools__boundInt__ShouldWork, - vision_tools_MathTools__boundFloat__ShouldWork, - vision_tools_MathTools__atan2__ShouldWork, - vision_tools_MathTools__atan__ShouldWork, - vision_tools_MathTools__asin__ShouldWork, - vision_tools_MathTools__acos__ShouldWork, - vision_tools_MathTools__abs__ShouldWork, - vision_tools_MathTools__PI__ShouldWork, - vision_tools_MathTools__PI_OVER_2__ShouldWork, - vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork, - vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork, - vision_tools_MathTools__NaN__ShouldWork, - vision_tools_MathTools__SQRT2__ShouldWork, - vision_tools_MathTools__SQRT3__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/PerspectiveWarpTests.hx b/tests/generated/src/tests/PerspectiveWarpTests.hx index 6c2a0b0b..87d5014e 100644 --- a/tests/generated/src/tests/PerspectiveWarpTests.hx +++ b/tests/generated/src/tests/PerspectiveWarpTests.hx @@ -28,6 +28,5 @@ class PerspectiveWarpTests { } } - public static var tests = [ - vision_algorithms_PerspectiveWarp__generateMatrix__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/PerwittTests.hx b/tests/generated/src/tests/PerwittTests.hx index 34057df3..ed9e3954 100644 --- a/tests/generated/src/tests/PerwittTests.hx +++ b/tests/generated/src/tests/PerwittTests.hx @@ -47,7 +47,5 @@ class PerwittTests { } } - public static var tests = [ - vision_algorithms_Perwitt__detectEdges__ShouldWork, - vision_algorithms_Perwitt__convolveWithPerwittOperator__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/PixelTests.hx b/tests/generated/src/tests/PixelTests.hx index 2f0dba35..6b33b08c 100644 --- a/tests/generated/src/tests/PixelTests.hx +++ b/tests/generated/src/tests/PixelTests.hx @@ -8,5 +8,5 @@ import vision.ds.Pixel; @:access(vision.ds.Pixel) class PixelTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx index 257efab6..b2999dd6 100644 --- a/tests/generated/src/tests/Point2DTests.hx +++ b/tests/generated/src/tests/Point2DTests.hx @@ -116,10 +116,5 @@ class Point2DTests { } } - public static var tests = [ - vision_ds_Point2D__toString__ShouldWork, - vision_ds_Point2D__radiansTo__ShouldWork, - vision_ds_Point2D__distanceTo__ShouldWork, - vision_ds_Point2D__degreesTo__ShouldWork, - vision_ds_Point2D__copy__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx index 644b01d4..0d43f0ab 100644 --- a/tests/generated/src/tests/Point3DTests.hx +++ b/tests/generated/src/tests/Point3DTests.hx @@ -75,8 +75,5 @@ class Point3DTests { } } - public static var tests = [ - vision_ds_Point3D__toString__ShouldWork, - vision_ds_Point3D__distanceTo__ShouldWork, - vision_ds_Point3D__copy__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/PointTransformationPairTests.hx b/tests/generated/src/tests/PointTransformationPairTests.hx index 6fea25e3..25e80baf 100644 --- a/tests/generated/src/tests/PointTransformationPairTests.hx +++ b/tests/generated/src/tests/PointTransformationPairTests.hx @@ -8,5 +8,5 @@ import vision.ds.specifics.PointTransformationPair; @:access(vision.ds.specifics.PointTransformationPair) class PointTransformationPairTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/QueueTests.hx b/tests/generated/src/tests/QueueTests.hx index 2930377d..dc1099ac 100644 --- a/tests/generated/src/tests/QueueTests.hx +++ b/tests/generated/src/tests/QueueTests.hx @@ -104,10 +104,5 @@ class QueueTests { } } - public static var tests = [ - vision_ds_Queue__toString__ShouldWork, - vision_ds_Queue__has__ShouldWork, - vision_ds_Queue__enqueue__ShouldWork, - vision_ds_Queue__dequeue__ShouldWork, - vision_ds_Queue__last__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx index c68c0583..e7369b99 100644 --- a/tests/generated/src/tests/RadixTests.hx +++ b/tests/generated/src/tests/RadixTests.hx @@ -10,5 +10,23 @@ import haxe.Int64; @:access(vision.algorithms.Radix) class RadixTests { - public static var tests = []; + public static function vision_algorithms_Radix__sort__ShouldWork():TestResult { + var result = null; + try { + var main = []; + + result = vision.algorithms.Radix.sort(main); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } + + } \ No newline at end of file diff --git a/tests/generated/src/tests/Ray2DTests.hx b/tests/generated/src/tests/Ray2DTests.hx index d2967b8d..d798a598 100644 --- a/tests/generated/src/tests/Ray2DTests.hx +++ b/tests/generated/src/tests/Ray2DTests.hx @@ -167,12 +167,5 @@ class Ray2DTests { } } - public static var tests = [ - vision_ds_Ray2D__from2Points__ShouldWork, - vision_ds_Ray2D__intersect__ShouldWork, - vision_ds_Ray2D__getPointAtY__ShouldWork, - vision_ds_Ray2D__getPointAtX__ShouldWork, - vision_ds_Ray2D__distanceTo__ShouldWork, - vision_ds_Ray2D__yIntercept__ShouldWork, - vision_ds_Ray2D__xIntercept__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/RectangleTests.hx b/tests/generated/src/tests/RectangleTests.hx index 83f42be4..da998fc6 100644 --- a/tests/generated/src/tests/RectangleTests.hx +++ b/tests/generated/src/tests/RectangleTests.hx @@ -8,5 +8,5 @@ import vision.ds.Rectangle; @:access(vision.ds.Rectangle) class RectangleTests { - public static var tests = []; + } \ No newline at end of file diff --git a/tests/generated/src/tests/RobertsCrossTests.hx b/tests/generated/src/tests/RobertsCrossTests.hx index 787679ee..9e53208b 100644 --- a/tests/generated/src/tests/RobertsCrossTests.hx +++ b/tests/generated/src/tests/RobertsCrossTests.hx @@ -27,6 +27,5 @@ class RobertsCrossTests { } } - public static var tests = [ - vision_algorithms_RobertsCross__convolveWithRobertsCross__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/SimpleHoughTests.hx b/tests/generated/src/tests/SimpleHoughTests.hx index 51cae1a4..814c45cd 100644 --- a/tests/generated/src/tests/SimpleHoughTests.hx +++ b/tests/generated/src/tests/SimpleHoughTests.hx @@ -29,6 +29,5 @@ class SimpleHoughTests { } } - public static var tests = [ - vision_algorithms_SimpleHough__mapLines__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/SimpleLineDetectorTests.hx b/tests/generated/src/tests/SimpleLineDetectorTests.hx index ff9eea47..53787f56 100644 --- a/tests/generated/src/tests/SimpleLineDetectorTests.hx +++ b/tests/generated/src/tests/SimpleLineDetectorTests.hx @@ -12,6 +12,25 @@ import vision.ds.IntPoint2D; @:access(vision.algorithms.SimpleLineDetector) class SimpleLineDetectorTests { + public static function vision_algorithms_SimpleLineDetector__p__ShouldWork():TestResult { + var result = null; + try { + var x = 0; + var y = 0; + + result = vision.algorithms.SimpleLineDetector.p(x, y); + } catch (e) { + + } + + return { + testName: "vision.algorithms.SimpleLineDetector.p", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork():TestResult { var result = null; try { @@ -53,7 +72,5 @@ class SimpleLineDetectorTests { } } - public static var tests = [ - vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork, - vision_algorithms_SimpleLineDetector__findLineFromPoint__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/SobelTests.hx b/tests/generated/src/tests/SobelTests.hx index 121c6e3e..491048eb 100644 --- a/tests/generated/src/tests/SobelTests.hx +++ b/tests/generated/src/tests/SobelTests.hx @@ -47,7 +47,5 @@ class SobelTests { } } - public static var tests = [ - vision_algorithms_Sobel__detectEdges__ShouldWork, - vision_algorithms_Sobel__convolveWithSobelOperator__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx index 8d2e4a70..784edf71 100644 --- a/tests/generated/src/tests/UInt16Point2DTests.hx +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -132,11 +132,5 @@ class UInt16Point2DTests { } } - public static var tests = [ - vision_ds_UInt16Point2D__toString__ShouldWork, - vision_ds_UInt16Point2D__toPoint2D__ShouldWork, - vision_ds_UInt16Point2D__toIntPoint2D__ShouldWork, - vision_ds_UInt16Point2D__toInt__ShouldWork, - vision_ds_UInt16Point2D__x__ShouldWork, - vision_ds_UInt16Point2D__y__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generated/src/tests/VisionTests.hx b/tests/generated/src/tests/VisionTests.hx index fb4faf7b..ddb0ae24 100644 --- a/tests/generated/src/tests/VisionTests.hx +++ b/tests/generated/src/tests/VisionTests.hx @@ -271,7 +271,7 @@ class VisionTests { var result = null; try { var image = new vision.ds.Image(100, 100); - var ranges:Array<{rangeStart:Color, rangeEnd:Color, replacement:Color}> = null; + var ranges = []; result = vision.Vision.replaceColorRanges(image, ranges); } catch (e) { @@ -917,49 +917,5 @@ class VisionTests { } } - public static var tests = [ - vision_Vision__whiteNoise__ShouldWork, - vision_Vision__vignette__ShouldWork, - vision_Vision__tint__ShouldWork, - vision_Vision__sobelEdgeDiffOperator__ShouldWork, - vision_Vision__sobelEdgeDetection__ShouldWork, - vision_Vision__smooth__ShouldWork, - vision_Vision__simpleImageSimilarity__ShouldWork, - vision_Vision__sharpen__ShouldWork, - vision_Vision__sepia__ShouldWork, - vision_Vision__saltAndPepperNoise__ShouldWork, - vision_Vision__robertEdgeDiffOperator__ShouldWork, - vision_Vision__replaceColorRanges__ShouldWork, - vision_Vision__projectiveTransform__ShouldWork, - vision_Vision__posterize__ShouldWork, - vision_Vision__pixelate__ShouldWork, - vision_Vision__pincushionDistortion__ShouldWork, - vision_Vision__perwittEdgeDiffOperator__ShouldWork, - vision_Vision__perwittEdgeDetection__ShouldWork, - vision_Vision__normalize__ShouldWork, - vision_Vision__nearestNeighborBlur__ShouldWork, - vision_Vision__mustacheDistortion__ShouldWork, - vision_Vision__medianBlur__ShouldWork, - vision_Vision__limitColorRanges__ShouldWork, - vision_Vision__laplacianOfGaussianEdgeDetection__ShouldWork, - vision_Vision__laplacianEdgeDiffOperator__ShouldWork, - vision_Vision__kmeansPosterize__ShouldWork, - vision_Vision__invert__ShouldWork, - vision_Vision__grayscale__ShouldWork, - vision_Vision__gaussianBlur__ShouldWork, - vision_Vision__fisheyeDistortion__ShouldWork, - vision_Vision__filterForColorChannel__ShouldWork, - vision_Vision__erode__ShouldWork, - vision_Vision__dropOutNoise__ShouldWork, - vision_Vision__dilate__ShouldWork, - vision_Vision__deepfry__ShouldWork, - vision_Vision__convolve__ShouldWork, - vision_Vision__convolutionRidgeDetection__ShouldWork, - vision_Vision__contrast__ShouldWork, - vision_Vision__combine__ShouldWork, - vision_Vision__cannyEdgeDetection__ShouldWork, - vision_Vision__blackAndWhite__ShouldWork, - vision_Vision__bilateralDenoise__ShouldWork, - vision_Vision__barrelDistortion__ShouldWork, - vision_Vision__affineTransform__ShouldWork]; + } \ No newline at end of file diff --git a/tests/generator/Detector.hx b/tests/generator/Detector.hx index 5a46437b..e5484553 100644 --- a/tests/generator/Detector.hx +++ b/tests/generator/Detector.hx @@ -8,10 +8,10 @@ class Detector { static var packageFinder = ~/^package ([\w.]+)/m; static var importFinder = ~/^import ([\w.*]+)/m; static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; - static var staticFunctionFinder = ~/(?:public static inline|public inline static|inline public static|public static) function (\w+)\((.*)\)(?::\w+)?\s*(?:$|{)/m; - static var staticFieldFinder = ~/(?:public static inline|public inline static|inline public static|public static) (?:var|final) (\w+)\(get, \w+\)/m; + static var staticFunctionFinder = ~/static.+?function (\w+)(?:)?\((.*)\)(?::\w+)?\s*(?:$|{)/m; + static var staticFieldFinder = ~/static.+?(?:var|final) (\w+)\(get, \w+\)/m; static var instanceFieldFinder = ~/(?:public inline|inline public|public) (?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)\((.*)\)(?::\w+)?\s*(?:$|{)/m; + static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)(?:)?\((.*)\)(?::\w+)?\s*(?:$|{)/m; static var constructorFinder = ~/function new\s*\((.*)\)/; public static function detectOnFile(pathToHaxeFile:String):TestDetections { diff --git a/tests/generator/Generator.hx b/tests/generator/Generator.hx index f9b9f068..45538e8e 100644 --- a/tests/generator/Generator.hx +++ b/tests/generator/Generator.hx @@ -6,7 +6,6 @@ import sys.io.File; using StringTools; - class Generator { @@ -74,7 +73,7 @@ class Generator { })); } - file.writeString(generateConstructor(detections)); + // file.writeString(generateConstructor(detections)); file.writeString(generateFileFooter()); @@ -131,7 +130,7 @@ class Generator { static function extractParameters(parameters:String):{declarations:String, injection:String} { - var regex = ~/(\w+):((?:EitherType<.+, .+>,?)|(?:\w+<\{.+\}>,?)|(?:\w|\.)+|\{.+\},?)/; + var regex = ~/(\w+):((?:\(.+?\)\s*->\s*\w+)|(?:\w+\s*->\s*\w+)|(?:(?:EitherType|Map)<.+, .+>)|(?:\w+<\{.+\}>)|(?:\w+<\w+>)|(?:\w|\.)+|\{.+\}),?/; var output = {declarations: "", injection: []} while (regex.match(parameters)) { var name = regex.matched(1); @@ -147,19 +146,23 @@ class Generator { }; } - static function getDefaultValueOf(valueType:String) { + static function getDefaultValueOf(valueType:String):String { return switch valueType { case "String": '""'; case "Int": "0"; case "Float": "0.0"; case "Bool": "false"; - case "Array" | "Map": "[]"; + case (_.startsWith("Array") || _.startsWith("Map") => true): "[]"; case "Point2D" | "IntPoint2D" | "Int16Point2D" | "UInt16Point2D": 'new vision.ds.$valueType(0, 0)'; case "Line2D": 'new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10})'; case "Ray2D": 'new vision.ds.Ray2D({x: 0, y: 0}, 1)'; case "ByteArray": 'vision.ds.ByteArray.from(0)'; case "Image": 'new vision.ds.Image(100, 100)'; case "T": "0"; // A little insane but should work in most cases so idk + case (_.startsWith("T") && _.contains("->") => true): "(_) -> null"; + case (_.contains("->") => true): + var commas = valueType.split("->")[0].split(",").length; + '(${[for (i in 0...commas) "_"].join(", ")}) -> null'; default: "null"; } } From d18cfb0e7de1ff07e6eae85661738b25ed5604c8 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sun, 8 Jun 2025 21:24:34 +0300 Subject: [PATCH 22/32] Standardized the way function signatres are written (void never declared, type always declared, inline always right before function, overload extern always at the beginning) --- src/vision/Vision.hx | 175 ++++++++++-------- .../algorithms/BilinearInterpolation.hx | 2 - src/vision/algorithms/Cramer.hx | 3 - src/vision/algorithms/Gauss.hx | 4 +- src/vision/algorithms/ImageHashing.hx | 2 - src/vision/algorithms/KMeans.hx | 3 +- src/vision/algorithms/Laplace.hx | 4 +- src/vision/algorithms/Perwitt.hx | 65 ++++--- src/vision/algorithms/Radix.hx | 6 +- src/vision/algorithms/RobertsCross.hx | 2 +- src/vision/algorithms/SimpleHough.hx | 2 +- src/vision/algorithms/SimpleLineDetector.hx | 2 +- src/vision/algorithms/Sobel.hx | 4 +- src/vision/ds/Array2D.hx | 3 +- src/vision/ds/ByteArray.hx | 22 +-- src/vision/ds/Color.hx | 8 +- src/vision/ds/Image.hx | 9 +- src/vision/ds/ImageFormat.hx | 2 +- src/vision/ds/ImageView.hx | 2 +- src/vision/ds/IntPoint2D.hx | 38 ++-- src/vision/ds/Line2D.hx | 6 +- src/vision/ds/Matrix2D.hx | 9 +- src/vision/ds/Point3D.hx | 6 +- src/vision/ds/Ray2D.hx | 2 +- .../formats/__internal/FormatImageLoader.hx | 2 +- src/vision/helpers/VisionThread.hx | 11 +- src/vision/tools/ArrayTools.hx | 20 +- src/vision/tools/ImageTools.hx | 6 +- src/vision/tools/MathTools.hx | 89 +++++---- 29 files changed, 246 insertions(+), 263 deletions(-) diff --git a/src/vision/Vision.hx b/src/vision/Vision.hx index 5730a8c0..e704c308 100644 --- a/src/vision/Vision.hx +++ b/src/vision/Vision.hx @@ -74,8 +74,9 @@ class Vision { @param image The image to combine on. When this function returns, that image should be modified @param with The second image to combine with. That image is preserved throughout the function. @param percentage The ratio between the contributions of each pixel within the two images, from 0 to 100: a lower value will make the first image's pixels contribute more to the the final image, thus making that image more similar to the first image, and vice-versa. + @return The combined image. The original copy (The first parameter) is modified. **/ - public static function combine(image:Image, ?with:Image, percentage:Float = 50) { + public static function combine(image:Image, ?with:Image, percentage:Float = 50):Image { if (with == null) with = new Image(image.width, image.height); final translated = percentage / 100; image.forEachPixelInView((x, y, first) -> { @@ -96,7 +97,7 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-tint.png)| @param image The image to tint - @param withColor The color to tint the image with. Each channel is considered separately, so a color with `alpha` of 0 won't affect other color channels. + @param withColor The color to tint the image with. Each channel is considered separately, so a color with `alpha` of 0 won't affect other color channels. Default is `Color.BLACK` @param percentage The amount by which to tint. `100` yields an image completely colored with `withColor`, while `0` yields the original image. Default is `50` @return The tinted image. The original image is modified. **/ @@ -125,9 +126,8 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-grayscale.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-grayscale&vision_better_grayscale.png)| @param image The image to be grayscaled. - @param simpleGrayscale When enabled, gets the gray by averaging pixel's color-channel values, instead of using a special ratio for more accurate grayscaling. Defaults to `false`. - - @return The grayscaled image. + @param simpleGrayscale When enabled, gets the gray by averaging pixel's color-channel values, instead of using a special ratio for more accurate grayscaling. Default is `false`. + @return The grayscaled image. The original image is modified. **/ public static function grayscale(image:Image, simpleGrayscale:Bool = false):Image { image.forEachPixelInView((x, y, pixel) -> { @@ -157,9 +157,9 @@ class Vision { @param image The image to be inverted. - @return The inverted image. + @return The inverted image. The original image is modified. **/ - public static function invert(image:Image) { + public static function invert(image:Image):Image { image.forEachPixelInView((x, y, pixel) -> { image.setUnsafePixel(x, y, Color.fromRGBA(255 - pixel.red, 255 - pixel.green, 255 - pixel.blue)); }); @@ -174,8 +174,12 @@ class Vision { | Original | `strength = 0.25` | |---|---| |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-sepia.png)| + + @param image The image to be tinted. + @param strength The amount of sepia to apply. The higher the value, the older the image looks. Default is `0.25`. + @return The tinted image. The original image is modified. **/ - public static function sepia(image:Image, strength:Float = 0.25) { + public static function sepia(image:Image, strength:Float = 0.25):Image { image.forEachPixelInView((x, y, pixel) -> { image.setUnsafePixel(x, y, Color.interpolate(pixel, Color.SEPIA, strength)); }); @@ -192,9 +196,8 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-blackAndWhite.png)| @param image The image to be converted. - @param threshold The threshold for converting to black and white: `threshold` is the maximum average of the three color components, that will still be considered black. `threshold` is a value between 0 and 255. The higher the value, the more "sensitive" the conversion. The default value is 128. - - @return The converted image. + @param threshold The threshold for converting to black and white: `threshold` is the maximum average of the three color components, that will still be considered black. `threshold` is a value between 0 and 255. The higher the value, the more "sensitive" the conversion. Default is `128`. + @return The converted image. The original image is modified. **/ public static function blackAndWhite(image:Image, threshold:Int = 128):Image { image.forEachPixelInView((x, y, pixel) -> { @@ -217,6 +220,7 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-contrast.png)| @param image The image to be contrasted. + @return The contrasted image. The original image is modified. **/ public static function contrast(image:Image):Image { return convolve(image, UnsharpMasking); @@ -234,11 +238,11 @@ class Vision { @param image The image to be smoothed. @param strength The strength of the smoothing. Higher values will result in more smoothing. Ranges from 0 to 1. Default is `0.1`. - @param affectAlpha If `true`, the alpha channel will be smoothed as well. Defaults to `false`. + @param affectAlpha If `true`, the alpha channel will be smoothed as well. Default is `false`. @param kernelRadius The radius of the smoothing kernel. Higher values will result in more smoothing. Default is `1`, which uses a 3x3 kernel. - @param circularKernel If `true`, the kernel will be circular. If `false`, the kernel will be square. + @param circularKernel If `true`, the kernel will be circular. If `false`, the kernel will be square. Default is `true`. @param iterations The number of times the smoothing should be applied. Higher values will result in more smoothing. Default is `1`. - @return The smoothed image. The given image is modified. + @return The smoothed image. The original image is modified. **/ public static function smooth(image:Image, strength:Float = 0.1, affectAlpha:Bool = false, kernelRadius:Int = 1, circularKernel:Bool = true, iterations:Int = 1):Image { var size = kernelRadius * 2 + 1; @@ -274,9 +278,9 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-pixelate.png)| @param image The image to pixelate - @param averagePixels Whether to use pixel averaging to get resulting pixels, or just use the original, remaining pixel. - @param pixelSize the new "pixel size" - @param affectAlpha Whether this effect applies to the alpha channel of each pixel or not + @param averagePixels Whether to use pixel averaging to get resulting pixels, or just use the original, remaining pixel. Default is `true`. + @param pixelSize the new "pixel size". Default is `2`. + @param affectAlpha Whether this effect applies to the alpha channel of each pixel or not. Default is `true`. @return The given image, pixelated. The original image is modified. **/ public static function pixelate(image:Image, averagePixels:Bool = true, pixelSize:Int = 2, affectAlpha:Bool = true):Image { @@ -326,10 +330,11 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-posterize.png)| @param image The image to be posterized. - @param bitsPerChannel The number of bits per channel. Defaults to `4`. Ranges from `1` to `8`. - @param affectAlpha If `true`, the alpha channel will be posterized as well. Defaults to `true`. + @param bitsPerChannel The number of bits per channel. Default is `4`. Ranges from `1` to `8`. + @param affectAlpha If `true`, the alpha channel will be posterized as well. Default is `true`. + @return The given image, posterized. The original image is modified. **/ - public static function posterize(image:Image, bitsPerChannel:Int = 4, affectAlpha:Bool = true) { + public static function posterize(image:Image, bitsPerChannel:Int = 4, affectAlpha:Bool = true):Image { var denominator = (256 / bitsPerChannel).floor(); // Is an integer anyways. image.forEachPixelInView((x, y, pixel) -> { var r = (pixel.red / denominator).round() * denominator; @@ -355,7 +360,7 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-sharpen.png)| @param image The image to be contrasted. - @return The sharpened image. The original copy is not preserved. + @return The sharpened image. The original copy is modified. **/ public static function sharpen(image:Image):Image { return convolve(image, Sharpen); @@ -372,8 +377,8 @@ class Vision { The higher the value, the more deepfried the image will look. @param image The image to be deepfried. - @param iterations The amount of times the image gets sharpened. default is `2`. - @return The deepfried image. The original copy is not preserved. + @param iterations The amount of times the image gets sharpened. Default is `2`. + @return The deepfried image. The original copy is modified. **/ public static function deepfry(image:Image, iterations:Int = 2):Image { for (i in 0...iterations) @@ -392,14 +397,14 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-vignette%28ratioDependent%20=%20true%29.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-vignette%28ratioDependent%20=%20false%29.png)| @param image The image to apply vignette on - @param strength in percentage, the amount of the image that has vignette, from the edge. Ranges from `0` to `1`. Defaults to `0.2` + @param strength in percentage, the amount of the image that has vignette, from the edge. Ranges from `0` to `1`. Default is `0.2`. @param intensity Determines how quickly vignette sets in when a pixel is supposed to be affected. The higher the value, the quicker it turns to the target color. The closer the value is to `0`, the slower it - turns into the target color, and the less effected the edges. + turns into the target color, and the less effected the edges. Default is `1`. @param ratioDependent DEtermines if the effect should always treat the image as a square, and thus be circular (`false`) or if it should consider different dimensions, - and appear "elliptical" (`true`) - @param color The target color for the vignette effect + and appear "elliptical" (`true`). Default is `false`. + @param color The target color for the vignette effect. Default is `Color.BLACK` @return the given image, with vignette applied. The original image is modified. **/ public static function vignette(image:Image, ?strength:Float = 0.2, ?intensity:Float = 1, ratioDependent:Bool = false, color:Color = Color.BLACK):Image { @@ -427,8 +432,8 @@ class Vision { @param image The image to apply the distortion to - @param strength The "amount" of warping done to the image. A higher value means pixels closer to the center are more distorted. @return Image - @returns the image, with fish-eye effect. The original image is preserved. + @param strength The "amount" of warping done to the image. A higher value means pixels closer to the center are more distorted. Default is `1.5`. + @return the given image, with fish-eye effect. The original image is preserved. **/ public static function fisheyeDistortion(image:Image, ?strength:Float = 1.5):Image { var centerX = image.width / 2, @@ -471,11 +476,11 @@ class Vision { @param image The image to distort @param strength The amount of distortion to apply. The higher the value the more distortion - there is. A negative value implies `Vision.pincushionDistortion`. + there is. A negative value implies `Vision.pincushionDistortion`. Values converging to 0 distort the image less and less. Default is `0.2`. - @returns A distorted copy of the given image. + @return The given image, with barrel distortion applied. The original image is preserved. **/ - public static function barrelDistortion(image:Image, ?strength:Float = 0.2) { + public static function barrelDistortion(image:Image, ?strength:Float = 0.2):Image { var centerX = image.width / 2, centerY = image.height / 2; var maxRadius = Math.min(centerX, centerY); @@ -518,9 +523,9 @@ class Vision { @param strength The amount of distortion to apply. The higher the value, the more distortion there is. A negative value implies `Vision.barrelDistortion`. Values converging to 0 distort the image less and less. Default is `0.2`. - @returns A distorted copy of the given image. The original image is preserved. + @return The given image, with pincushion distortion applied. The original image is preserved. **/ - public static function pincushionDistortion(image:Image, ?strength:Float = 0.2) { + public static function pincushionDistortion(image:Image, ?strength:Float = 0.2):Image { return barrelDistortion(image, -strength); } @@ -536,12 +541,12 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![Processed](https://spacebubble-io.pages.dev/vision/docs/valve-barrelDistortion.png)|![Processed](https://spacebubble-io.pages.dev/vision/docs/valve-pincushionDistortion.png)|![Processed](https://spacebubble-io.pages.dev/vision/docs/valve-mustacheDistortion.png)| @param image The image to distort - @param strength The amount of distortion to apply. The higher the value, the more distortion + @param amplitude The amount of distortion to apply. The higher the value, the more distortion there is. A negative value flips the effect. Values converging to 0 distort the image less and less. Default is `0.2`. - @returns A distorted copy of the image. The original image is preserved. + @return The given image, with mustache distortion applied. The original image is preserved. **/ - public static function mustacheDistortion(image:Image, amplitude:Float = 0.2) { + public static function mustacheDistortion(image:Image, amplitude:Float = 0.2):Image { var centerX = image.width / 2, centerY = image.height / 2; var maxRadius = Math.min(centerX, centerY); @@ -589,10 +594,18 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-dilate.png)| @param image The image to operate on. - @param dilationRadius The radius of the kernel used for the dilation process. The radius does not include the center pixel, so a radius of `2` should give a `5x5` kernel. The higher this value, the further each pixel checks for a nearby lighter pixel. - @param colorImportanceOrder Since there may be conflicts when calculating the difference in lightness between colors with similar values in different color channels (e.g. `0xFF0000` and `0x0000FF` - channel values are "similar", colors are not), this parameter is used to favor the given color channels. The default is `RedGreenBlue` - `red` is the most important, and is considered the "lightest", followed by green, and blue is considered the "darkest". - @param circularKernel When enabled, the kernel used to loop over the pixels becomes circular instead of being a square. This results in a slight performance increase, and a massive quality increase. Turned on by default. - @return The dilated image. The original copy is not preserved. + @param dilationRadius The radius of the kernel used for the dilation process. + The radius does not include the center pixel, so a radius of `2` should give a `5x5` kernel. + The higher this value, the further each pixel checks for a nearby lighter pixel. Default is `2`. + @param colorImportanceOrder Since there may be conflicts when calculating the difference in lightness + between colors with similar values in different color channels + (e.g. `0xFF0000` and `0x0000FF` - channel values are "similar", colors are not), + this parameter is used to favor the given color channels. Default is `RedGreenBlue` - + `red` is the most important, and is considered the "lightest", followed by green, + and blue is considered the "darkest". + @param circularKernel When enabled, the kernel used to loop over the pixels becomes circular instead of being a + square. This results in a slight performance increase, and a great quality increase. Default is `true`. + @return The dilated image. The original copy is modified. **/ public static function dilate(image:Image, ?dilationRadius:Int = 2, ?colorImportanceOrder:ColorImportanceOrder = RedGreenBlue, circularKernel:Bool = true):Image { var intermediate = image.clone(); @@ -627,10 +640,17 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-erode.png)| @param image The image to operate on. - @param dilationRadius The radius of the kernel used for the erosion process. The radius does not include the center pixel, so a radius of `2` should give a `5x5` kernel. The higher this value, the further each pixel checks for a nearby darker pixel. - @param colorImportanceOrder Since there may be conflicts when calculating the difference in darkness between colors with similar values in different color channels (e.g. `0xFF0000` and `0x0000FF` - channel values are "similar", colors are not), this parameter is used to favor the given color channels. The default is `RedGreenBlue` - `red` is the most important, and is considered the "darkest", followed by green, and blue is considered the "lightest". - @param circularKernel When enabled, the kernel used to loop over the pixels becomes circular instead of being a square. This results in a slight performance increase, and a massive quality increase. Turned on by default. - @return The eroded image. The original copy is not preserved. + @param dilationRadius The radius of the kernel used for the erosion process. + The radius does not include the center pixel, so a radius of `2` should give a `5x5` kernel. + The higher this value, the further each pixel checks for a nearby darker pixel. Default is `2`. + @param colorImportanceOrder Since there may be conflicts when calculating the difference in darkness between + colors with similar values in different color channels + (e.g. `0xFF0000` and `0x0000FF` - channel values are "similar", colors are not), this parameter is used to + favor the given color channels. The default is `RedGreenBlue` - `red` is the most important, and is considered + the "darkest", followed by green, and blue is considered the "lightest". + @param circularKernel When enabled, the kernel used to loop over the pixels becomes circular instead of being a + square. This results in a slight performance increase, and a massive quality increase. Default is `true`. + @return The eroded image. The original copy is modified. **/ public static function erode(image:Image, ?erosionRadius:Int = 2, ?colorImportanceOrder:ColorImportanceOrder = RedGreenBlue, circularKernel:Bool = true):Image { var intermediate = image.clone(); @@ -658,10 +678,11 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-saltAndPepperNoise.png) @param image The image to apply salt&pepper noise on. - @param percentage How much of the image should be "corrupted", in percentages between 0 to 100 - 0 means no change, 100 means fully "corrupted". Default is 25. - @return The noisy image. The original copy is not preserved. + @param percentage How much of the image should be "corrupted", in percentages between `0` to `100` - `0` + means no change, `100` means fully "corrupted". Default is `25`. + @return The noisy image. The original copy is modified. - @see Color.interpolate() + @see **`Color.interpolate()`** **/ public static function saltAndPepperNoise(image:Image, percentage:Float = 25):Image { var translated = percentage / 100; @@ -691,9 +712,12 @@ class Vision { |---|---| |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-dropOutNoise.png) - @param image The image to apply salt&pepper noise on - @param percentage How much of the image should be "corrupted", in percentages between 0 to 100 - 0 means no change, 100 means fully "corrupted". Default is 5 - @return The noisy image. The original copy is not preserved. + @param image The image to apply drop-out noise on + @param percentage How much of the image should be "corrupted", in percentages between `0` to `100` - + `0` means no change, `100` means fully "corrupted". Default is `5`. + @param threshold The threshold at which a pixel is considered "black" or "white". A color measures against + this threshold by grabbing the largest color channel value, and comparing it. Default is `128`. + @return The noisy image. The original copy is modified. **/ public static function dropOutNoise(image:Image, percentage:Float = 5, threshold:Int = 128):Image { var translated = percentage / 100; @@ -720,9 +744,9 @@ class Vision { @param image The image to apply salt&pepper noise on @param percentage How white-noisy the resulting image should be, or, the ratio between the contributions of each pixel from the original image and the white noise to the final image, from 0 to 100: a lower value will make the first image's pixels contribute more to the the final image, thus making the resulting image less noisy, and vice-versa. @param whiteNoiseRange The number of shades of gray used to generate the white noise. Shouldn't really effect performance, but you may want to change it to get a "higher/lower quality" white noise. - @return The noisy image. The original copy is not preserved. + @return The noisy image. The original copy is modified. **/ - public static function whiteNoise(image:Image, percentage:Float = 25, whiteNoiseRange:WhiteNoiseRange = RANGE_16) { + public static function whiteNoise(image:Image, percentage:Float = 25, whiteNoiseRange:WhiteNoiseRange = RANGE_16):Image { var colorVector:Vector = new Vector(whiteNoiseRange); colorVector[0] = 0; colorVector[colorVector.length - 1] = 255; @@ -761,7 +785,7 @@ class Vision { @param image The image to be normalized. @param rangeStart The start of the range of channels. By default, this value is `0x00000000` @param rangeEnd The end of the range of channels. By default, this value is `0xFFFFFFFF` - @return The normalized image. The original copy is not preserved. + @return The normalized image. The original copy is modified. **/ public static function normalize(image:Image, rangeStart:Color = 0x00000000, rangeEnd:Color = 0xFFFFFFFF):Image { var max:Color = 0x0, min:Color = 0x0, step:Color = 0x0; @@ -791,7 +815,7 @@ class Vision { @param image The image to be li processed. @param rangeStart The start of the range of channels. By default, this value is `0x00000000` @param rangeEnd The end of the range of channels. By default, this value is `0xFFFFFFFF` - @return The normalized image. The original copy is not preserved. + @return The normalized image. The original copy is modified. **/ public static function limitColorRanges(image:Image, rangeStart:Color = 0x00000000, rangeEnd:Color = 0xFFFFFFFF):Image { image.forEachPixelInView((x, y, color) -> { @@ -812,7 +836,7 @@ class Vision { @param image The image process. @param ranges array of color ranges & replacement colors. - @return A processed version of the image. The original image is not preserved. + @return A processed version of the image. The original image is modified. **/ public static function replaceColorRanges(image:Image, ?ranges:Array<{rangeStart:Color, rangeEnd:Color, replacement:Color}>):Image { if (ranges == null) return image; @@ -840,7 +864,7 @@ class Vision { @param image The image to be processed @param channel The color channel to be isolated - @return The processed image. The original image is not preserved + @return The processed image. The original image is modified **/ public static function filterForColorChannel(image:Image, channel:ColorChannel = ColorChannel.RED):Image { var output = image.clone(); @@ -889,7 +913,7 @@ class Vision { @param image the image to be manipulated @param kernel the type/value of the kernel. can be: **`Identity`**, **`BoxBlur`**, **`RidgeDetection`**, **`Sharpen`**, **`UnsharpMasking`**, **`Assemble3x3`**, **`Assemble5x5`**, or just a matrix: both `convolve(image, BoxBlur)` and `convolve(image, [[1,1,1],[1,1,1],[1,1,1]])` are valid ways to represent a box blur. - @return A convolved version of the image. The original image is not preserved. + @return A convolved version of the image. The original image is modified. **/ public static function convolve(image:Image, kernel:EitherType>> = Identity):Image { var matrix:Array>; @@ -978,16 +1002,16 @@ class Vision { @param image The image to manipulate. @param matrix a transformation matrix to use when manipulating the image. expects a 3x3 matrix. any other size may throw an error. - @param expansionMode how to expand the image if the matrix moves the image outside of its original bounds, or never reaches the original bounds. Defaults to `ImageExpansionMode.SAME_SIZE`. - @param originPoint **OPTION 1**: the point in the image to use as the origin of the transformation matrix. Before a point is passed to the matrix, it's coordinates are incremented by this point, and after the matrix is applied, it's coordinates are decremented by this point. Useful for rotation transformations. Defaults to `(0, 0)`. - @param originMode **OPTION 2**: To avoid code-bloat, you can provide a pre-made representation of the origin point, via `TransformationMatrixOrigination` enum. Defaults to `TransformationMatrixOrigination.TOP_LEFT`. - @returns A new, manipulated image. The provided image remains unchanged. + @param expansionMode how to expand the image if the matrix moves the image outside of its original bounds, or never reaches the original bounds. Default is `ImageExpansionMode.SAME_SIZE`. + @param originPoint **OPTION 1**: the point in the image to use as the origin of the transformation matrix. Before a point is passed to the matrix, it's coordinates are incremented by this point, and after the matrix is applied, it's coordinates are decremented by this point. Useful for rotation transformations. Default is `(0, 0)`. + @param originMode **OPTION 2**: To avoid code-bloat, you can provide a pre-made representation of the origin point, via `TransformationMatrixOrigination` enum. Default is `TransformationMatrixOrigination.TOP_LEFT`. + @return A new, manipulated image. The provided image remains unchanged. @throws MatrixMultiplicationError if the size of the given matrix is not 3x3. @see `Vision.convolve()` for color-manipulation matrices (or, kernels). @see `Vision.perspectiveWarp()` for "3d" manipulations. **/ - public static function affineTransform(image:Image, ?matrix:TransformationMatrix2D, expansionMode:ImageExpansionMode = RESIZE, ?originPoint:Point2D, ?originMode:TransformationMatrixOrigination = CENTER) { + public static function affineTransform(image:Image, ?matrix:TransformationMatrix2D, expansionMode:ImageExpansionMode = RESIZE, ?originPoint:Point2D, ?originMode:TransformationMatrixOrigination = CENTER):Image { if (matrix == null) matrix = Matrix2D.IDENTITY(); // Get the max values for bounds expansion var mix = MathTools.POSITIVE_INFINITY, max = MathTools.NEGATIVE_INFINITY, miy = MathTools.POSITIVE_INFINITY, may = MathTools.NEGATIVE_INFINITY; @@ -1036,7 +1060,6 @@ class Vision { y = 0; } - // Interpolate missing pixels, using bilinear interpolation. pixel radius is chosen by the ratio of the distance from `mix to max` to width, same for height. return img; } @@ -1061,7 +1084,7 @@ class Vision { @param image The image to manipulate. @param matrix a transformation matrix to use when manipulating the image. expects a 3x3 matrix. any other size may throw an error. - @param expansionMode How to expand the image's bounds when the resulting image after transformation changes dimensions. Defaults to `RESIZE`. + @param expansionMode How to expand the image's bounds when the resulting image after transformation changes dimensions. Default is `RESIZE`. **/ public static function projectiveTransform(image:Image, ?matrix:TransformationMatrix2D, expansionMode:ImageExpansionMode = RESIZE):Image { @@ -1122,7 +1145,7 @@ class Vision { @param image The image to be blurred. @param iterations The number of times the algorithm will be run. The more iterations, the more blurry the image will be, and the higher the "blur range". **For example:** a value of 3 will produce a blur range of 3 pixels on each object. - @return A blurred version of the image. The original image is not preserved. + @return A blurred version of the image. The original image is modified. **/ public static function nearestNeighborBlur(image:Image, iterations:Int = 1):Image { for (i in 0...iterations) image = convolve(image, BoxBlur); @@ -1149,7 +1172,7 @@ class Vision { @param sigma The sigma value to use for the gaussian distribution on the kernel. a lower value will focus more on the center pixel, while a higher value will shift focus to the surrounding pixels more, effectively blurring it better. @param kernelSize The size of the kernel (`width` & `height`) @throws InvalidGaussianKernelSize if the kernel size is even, negative or `0`, this error is thrown. - @return A blurred version of the image. The original image is not preserved. + @return A blurred version of the image. The original image is modified. **/ public static function gaussianBlur(image:Image, ?sigma:Float = 1, ?kernelSize:GaussianKernelSize = GaussianKernelSize.X5, ?fast:Bool = false):Image { if (fast) return Gauss.fastBlur(image, kernelSize, sigma); @@ -1170,7 +1193,7 @@ class Vision { @param image The image to apply median blurring to. @param kernelSize the width & height of the kernel in which we should search for the median. A radius of `9` will check in a `19x19` (`radius(9)` + `center(1)` + `radius(9)`) square around the center pixel. - @return A filtered version of the image, using median blurring. The original image is not preserved. + @return A filtered version of the image, using median blurring. The original image is modified. **/ public static function medianBlur(image:Image, kernelSize:Int = 5):Image { var median = image.clone(); @@ -1255,7 +1278,7 @@ class Vision { @param image The image to be operated on @return A new image, containing the gradients of the edges as whitened pixels. **/ - public static function sobelEdgeDiffOperator(image:Image) { + public static function sobelEdgeDiffOperator(image:Image):Image { return Sobel.convolveWithSobelOperator(grayscale(image.clone())); } @@ -1276,7 +1299,7 @@ class Vision { @param image The image to be operated on @return A new image, containing the gradients of the edges as whitened pixels. **/ - public static function perwittEdgeDiffOperator(image:Image) { + public static function perwittEdgeDiffOperator(image:Image):Image { return Perwitt.convolveWithPerwittOperator(grayscale(image.clone())); } @@ -1298,7 +1321,7 @@ class Vision { @param image The image to be operated on @return A new image, containing the gradients of the edges as whitened pixels. **/ - public static function robertEdgeDiffOperator(image:Image) { + public static function robertEdgeDiffOperator(image:Image):Image { return RobertsCross.convolveWithRobertsCross(grayscale(image.clone())); } @@ -1320,7 +1343,7 @@ class Vision { @param filterPositive Which version of the laplacian filter should the function use: the negative (detects "outward" edges), or the positive (detects "inward" edges). Default is positive (`true`). @return A new image, containing the gradients of the edges as whitened pixels. **/ - public static function laplacianEdgeDiffOperator(image:Image, filterPositive:Bool = true) { + public static function laplacianEdgeDiffOperator(image:Image, filterPositive:Bool = true):Image { return Laplace.convolveWithLaplacianOperator(image.clone(), filterPositive); } @@ -1422,7 +1445,7 @@ class Vision { @param kernelSize The size of the kernel (`width` & `height`) - a kernel size of `7`/ will produce a `7x7` kernel. Default is `GaussianKernelSize.X3`. @return A new, black and white image, with white pixels being the detected edges. **/ - public static function laplacianOfGaussianEdgeDetection(image:Image, ?threshold:Int = 2, ?filterPositive:Bool = true, ?sigma:Float = 1, ?kernelSize:GaussianKernelSize = X3) { + public static function laplacianOfGaussianEdgeDetection(image:Image, ?threshold:Int = 2, ?filterPositive:Bool = true, ?sigma:Float = 1, ?kernelSize:GaussianKernelSize = X3):Image { return Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, filterPositive); } @@ -1552,7 +1575,7 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansPosterize%28maxColorCount%20=%2016%29.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansPosterize%28maxColorCount%20=%208%29.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansPosterize%28maxColorCount%20=%204%29.png)| @param image The image to posterize - @param maxColorCount The amount of colors to use for the resulting image. At the algorithm's level, this also means the amount of color clusters to calculate. Defaults to `16` + @param maxColorCount The amount of colors to use for the resulting image. At the algorithm's level, this also means the amount of color clusters to calculate. Default is `16` @return A posterized version of the image. The original image is preserved **/ public static function kmeansPosterize(image:Image, maxColorCount:Int = 16):Image { @@ -1586,8 +1609,8 @@ class Vision { |![Before](https://spacebubble-io.pages.dev/vision/docs/valve-original.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansGroupImageColors%28groupCount%20=%2016%29.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansGroupImageColors%28groupCount%20=%208%29.png)|![After](https://spacebubble-io.pages.dev/vision/docs/valve-kmeansGroupImageColors%28groupCount%20=%204%29.png)| @param image The image to try color grouping on - @param groupCount The amount of color groups we want to find. The more groups, the more accurate the grouping will be, but only to a certain point (an image with only 4 distinct colors won't have more than 4 groups). Defaults to `16` - @param considerTransparency Whether or not to consider transparency in the grouping. Defaults to `false` + @param groupCount The amount of color groups we want to find. The more groups, the more accurate the grouping will be, but only to a certain point (an image with only 4 distinct colors won't have more than 4 groups). Default is `16` + @param considerTransparency Whether or not to consider transparency in the grouping. Default is `false` @return An array of color clusters. Each cluster contains both it's colors and the centroid used to group them. **/ public static function kmeansGroupImageColors(image:Image, groupCount:Int = 16, considerTransparency:Bool = false):Array { diff --git a/src/vision/algorithms/BilinearInterpolation.hx b/src/vision/algorithms/BilinearInterpolation.hx index 74f8b7d4..00d8d593 100644 --- a/src/vision/algorithms/BilinearInterpolation.hx +++ b/src/vision/algorithms/BilinearInterpolation.hx @@ -1,8 +1,6 @@ package vision.algorithms; import vision.ds.Color; -import vision.tools.ImageTools; -import vision.exceptions.OutOfBounds; import vision.ds.Image; import vision.tools.MathTools.*; diff --git a/src/vision/algorithms/Cramer.hx b/src/vision/algorithms/Cramer.hx index fbaa7b4d..c45b4b94 100644 --- a/src/vision/algorithms/Cramer.hx +++ b/src/vision/algorithms/Cramer.hx @@ -2,10 +2,7 @@ package vision.algorithms; import vision.exceptions.InvalidCramerSetup; import vision.exceptions.InvalidCramerCoefficientsMatrix; -import vision.tools.MathTools; import vision.ds.Matrix2D; -import haxe.ds.Vector; -import vision.ds.Array2D; /** Solve a system of linear equations using Cramer's rule. diff --git a/src/vision/algorithms/Gauss.hx b/src/vision/algorithms/Gauss.hx index ced34276..1d008d0d 100644 --- a/src/vision/algorithms/Gauss.hx +++ b/src/vision/algorithms/Gauss.hx @@ -115,7 +115,7 @@ class Gauss { return kernel; } @:deprecated("Gaussian.createKernelOfSize() is deprecated. use Gaussian.create2DKernelOfSize() instead") - public static function createKernelOfSize(size:Int, sigma:Int) { + public static function createKernelOfSize(size:Int, sigma:Int):Array2D { return create2DKernelOfSize(size, sigma); } @@ -172,7 +172,7 @@ class Gauss { return kernel; } - public static function fastBlur(image:Image, size:Int, sigma:Float) { + public static function fastBlur(image:Image, size:Int, sigma:Float):Image { var preprocessed = image.clone(); #if vision_quiet if (size <= 0) size = -size; diff --git a/src/vision/algorithms/ImageHashing.hx b/src/vision/algorithms/ImageHashing.hx index c2adf184..13b46982 100644 --- a/src/vision/algorithms/ImageHashing.hx +++ b/src/vision/algorithms/ImageHashing.hx @@ -2,10 +2,8 @@ package vision.algorithms; import haxe.Int64; import vision.ds.Matrix2D; -import vision.tools.ImageTools; import vision.ds.ByteArray; import vision.ds.Image; -import vision.ds.ImageResizeAlgorithm; using vision.tools.MathTools; diff --git a/src/vision/algorithms/KMeans.hx b/src/vision/algorithms/KMeans.hx index 3b2323cf..28edc125 100644 --- a/src/vision/algorithms/KMeans.hx +++ b/src/vision/algorithms/KMeans.hx @@ -9,8 +9,7 @@ using vision.tools.MathTools; using vision.tools.ArrayTools; class KMeans { - public static function generateClustersUsingConvergence(values:Array, clusterAmount:Int, distanceFunction:(T, T) -> Float, - averageFunction:Array->T):Array> { + public static function generateClustersUsingConvergence(values:Array, clusterAmount:Int, distanceFunction:(T, T) -> Float, averageFunction:Array->T):Array> { var clusterCenters = pickElementsAtRandom(values, clusterAmount, true); // We don't use clusterAmount in case where the image doesnt have enough distinct colors to satisfy diff --git a/src/vision/algorithms/Laplace.hx b/src/vision/algorithms/Laplace.hx index 888a1ff4..0a52c86d 100644 --- a/src/vision/algorithms/Laplace.hx +++ b/src/vision/algorithms/Laplace.hx @@ -7,7 +7,7 @@ import vision.ds.Image; class Laplace { - public static function convolveWithLaplacianOperator(image:Image, positive:Bool) { + public static function convolveWithLaplacianOperator(image:Image, positive:Bool):Image { var edgeColors:Image = new Image(image.width, image.height); for (i in 0...image.width) { @@ -28,7 +28,7 @@ class Laplace { return edgeColors; } - public static function laplacianOfGaussian(image:Image, kernelSize:GaussianKernelSize, sigma:Float, threshold:Float, positive:Bool) { + public static function laplacianOfGaussian(image:Image, kernelSize:GaussianKernelSize, sigma:Float, threshold:Float, positive:Bool):Image { var returned = new Image(image.width, image.height); var blurred = Vision.gaussianBlur(image.clone().removeView(), sigma, kernelSize); var imageToProcess:Image; diff --git a/src/vision/algorithms/Perwitt.hx b/src/vision/algorithms/Perwitt.hx index 9a08c988..b640d6e9 100644 --- a/src/vision/algorithms/Perwitt.hx +++ b/src/vision/algorithms/Perwitt.hx @@ -11,7 +11,7 @@ using vision.tools.MathTools; * by [Shahar Marcus](https://www.github.com/ShaharMS) */ class Perwitt { - public static function convolveWithPerwittOperator(image:Image) { + public static function convolveWithPerwittOperator(image:Image):Image { var edgeColors:Image = new Image(image.width, image.height); var maxGradient = -1; @@ -39,7 +39,7 @@ class Perwitt { if (gradient > maxGradient) maxGradient = gradient; final rgb:Int = Std.int(gradient * (255 / maxGradient)); - //turn into ARGB + // turn into ARGB edgeColors.setPixel(i, j, 0xff000000 | (rgb << 16) | (rgb << 8) | rgb); } } @@ -62,6 +62,7 @@ class Perwitt { } // If you came here for the explanation of the algorithm, Congrats! learning is fun :D + /** What does this algorithm do? Basically, it takes 9 pixels chunks each time it performs a calculation, and tries to see how different the @@ -82,38 +83,36 @@ class Perwitt { Now, if this value is greater than the threshold, then we declare it an edge. now, were gonna do the same thing for all chunks of the image, and from top to bottom too if needed. **/ - public static function detectEdges(image:Image, threshold:Float) { - - - var edges = new Image(image.width, image.height, Color.fromRGBA(0, 0, 0)); - var blackAndWhite = Vision.grayscale(image.clone()); - for (x in 0...blackAndWhite.width) { - for (y in 0...blackAndWhite.height) { - var neighbors = [ - blackAndWhite.getSafePixel(x - 1, y - 1), - blackAndWhite.getSafePixel(x, y - 1), - blackAndWhite.getSafePixel(x + 1, y - 1), - blackAndWhite.getSafePixel(x - 1, y), - blackAndWhite.getSafePixel(x, y), - blackAndWhite.getSafePixel(x + 1, y), - blackAndWhite.getSafePixel(x - 1, y + 1), - blackAndWhite.getSafePixel(x, y + 1), - blackAndWhite.getSafePixel(x + 1, y + 1) - ]; - final perwittCalculationIterationLTR = neighbors[0].red * -1 - + neighbors[3].red * -1 + neighbors[6].red * -1 + neighbors[2].red * 1 + neighbors[5].red * 1 + neighbors[8].red * 1; - if (Math.abs(perwittCalculationIterationLTR) > threshold) { - edges.setPixel(x, y, Color.fromRGBA(255, 255, 255)); - continue; - } - final perwittCalculationIterationTTB = neighbors[0].red * -1 - + neighbors[1].red * -1 + neighbors[2].red * -1 + neighbors[6].red * 1 + neighbors[7].red * 1 + neighbors[8].red * 1; - if (Math.abs(perwittCalculationIterationTTB) > threshold) { - edges.setPixel(x, y, Color.fromRGBA(255, 255, 255)); - continue; - } + public static function detectEdges(image:Image, threshold:Float):Image { + var edges = new Image(image.width, image.height, Color.fromRGBA(0, 0, 0)); + var blackAndWhite = Vision.grayscale(image.clone()); + for (x in 0...blackAndWhite.width) { + for (y in 0...blackAndWhite.height) { + var neighbors = [ + blackAndWhite.getSafePixel(x - 1, y - 1), + blackAndWhite.getSafePixel(x, y - 1), + blackAndWhite.getSafePixel(x + 1, y - 1), + blackAndWhite.getSafePixel(x - 1, y), + blackAndWhite.getSafePixel(x, y), + blackAndWhite.getSafePixel(x + 1, y), + blackAndWhite.getSafePixel(x - 1, y + 1), + blackAndWhite.getSafePixel(x, y + 1), + blackAndWhite.getSafePixel(x + 1, y + 1) + ]; + final perwittCalculationIterationLTR = neighbors[0].red * -1 + + neighbors[3].red * -1 + neighbors[6].red * -1 + neighbors[2].red * 1 + neighbors[5].red * 1 + neighbors[8].red * 1; + if (Math.abs(perwittCalculationIterationLTR) > threshold) { + edges.setPixel(x, y, Color.fromRGBA(255, 255, 255)); + continue; + } + final perwittCalculationIterationTTB = neighbors[0].red * -1 + + neighbors[1].red * -1 + neighbors[2].red * -1 + neighbors[6].red * 1 + neighbors[7].red * 1 + neighbors[8].red * 1; + if (Math.abs(perwittCalculationIterationTTB) > threshold) { + edges.setPixel(x, y, Color.fromRGBA(255, 255, 255)); + continue; } } - return edges; + } + return edges; } } diff --git a/src/vision/algorithms/Radix.hx b/src/vision/algorithms/Radix.hx index f85c91ab..68899407 100644 --- a/src/vision/algorithms/Radix.hx +++ b/src/vision/algorithms/Radix.hx @@ -84,7 +84,7 @@ class Radix { /** Sorts an array of `Int`s / `UInt`s / `Int64` using **Radix Sort**. **/ - public static overload extern inline function sort(main:Array) { + overload extern public static inline function sort(main:Array):Array { var negatives = [], positives = []; for (i in 0...main.length) { @@ -113,7 +113,7 @@ class Radix { return main = negatives.concat(positives); } - public static overload extern inline function sort(main:Array) { + overload extern public static inline function sort(main:Array):Array { // Find the maximum number to know the number of digits final max = getMax(main, main.length); var exp = 1; @@ -129,7 +129,7 @@ class Radix { return main; } - public static overload extern inline function sort(main:Array) { + overload extern public static inline function sort(main:Array):Array { var negatives = [], positives = []; for (i in 0...main.length) { diff --git a/src/vision/algorithms/RobertsCross.hx b/src/vision/algorithms/RobertsCross.hx index 0bc7941f..50193b70 100644 --- a/src/vision/algorithms/RobertsCross.hx +++ b/src/vision/algorithms/RobertsCross.hx @@ -13,7 +13,7 @@ import vision.ds.Image; **/ class RobertsCross { - public static function convolveWithRobertsCross(image:Image) { + public static function convolveWithRobertsCross(image:Image):Image { var edgeColors:Image = new Image(image.width, image.height); var maxGradient = -1; diff --git a/src/vision/algorithms/SimpleHough.hx b/src/vision/algorithms/SimpleHough.hx index dd897c52..8c8bf4c7 100644 --- a/src/vision/algorithms/SimpleHough.hx +++ b/src/vision/algorithms/SimpleHough.hx @@ -34,7 +34,7 @@ class SimpleHough { return rays; } - public static function mapLines(image:Image, rays:Array) { + public static function mapLines(image:Image, rays:Array):Image { for (ray in rays) { image.drawRay2D(ray, Color.CYAN); } diff --git a/src/vision/algorithms/SimpleLineDetector.hx b/src/vision/algorithms/SimpleLineDetector.hx index 0192559a..cb8efa89 100644 --- a/src/vision/algorithms/SimpleLineDetector.hx +++ b/src/vision/algorithms/SimpleLineDetector.hx @@ -174,7 +174,7 @@ class SimpleLineDetector { return lines; } - static extern inline function p(x:Int = 0, y:Int = 0) { + static extern inline function p(x:Int = 0, y:Int = 0):Int16Point2D { return new Int16Point2D(x, y); } diff --git a/src/vision/algorithms/Sobel.hx b/src/vision/algorithms/Sobel.hx index 9f1128cd..8af7b715 100644 --- a/src/vision/algorithms/Sobel.hx +++ b/src/vision/algorithms/Sobel.hx @@ -11,7 +11,7 @@ using vision.tools.MathTools; by [Shahar Marcus](https://www.github.com/ShaharMS) **/ class Sobel { - public static function convolveWithSobelOperator(image:Image) { + public static function convolveWithSobelOperator(image:Image):Image { var edgeColors:Image = new Image(image.width, image.height); var maxGradient = -1; @@ -68,7 +68,7 @@ class Sobel { If this value is greater than the threshold, then we declare it an edge. now, were gonna do the same thing for all chunks of the image, and from top to bottom too if needed. **/ - public static function detectEdges(image:Image, threshold:Float) { + public static function detectEdges(image:Image, threshold:Float):Image { final edges = new Image(image.width, image.height, Color.fromRGBA(0, 0, 0)); final blackAndWhite = Vision.grayscale(image.clone()); for (x in 0...blackAndWhite.width) { diff --git a/src/vision/ds/Array2D.hx b/src/vision/ds/Array2D.hx index e43d73c1..32929e2c 100644 --- a/src/vision/ds/Array2D.hx +++ b/src/vision/ds/Array2D.hx @@ -1,5 +1,6 @@ package vision.ds; +import haxe.iterators.ArrayIterator; #if !vision_fancy_array_access /** A 2D array, faster than an `Array>`. @@ -106,7 +107,7 @@ class Array2D { `(x, y)...(x + 5, y) -> (x, y + 1)...(x + 5, y + 1) -> (x, y + 2)...` **/ - public inline function iterator() { + public inline function iterator():ArrayIterator { return inner.iterator(); } diff --git a/src/vision/ds/ByteArray.hx b/src/vision/ds/ByteArray.hx index e9ec41ec..66c9ac0a 100644 --- a/src/vision/ds/ByteArray.hx +++ b/src/vision/ds/ByteArray.hx @@ -3,7 +3,6 @@ package vision.ds; import haxe.Int64; import vision.tools.MathTools; import haxe.Serializer; -import haxe.io.BytesData; import haxe.io.Bytes; /** @@ -18,13 +17,13 @@ abstract ByteArray(Bytes) from Bytes to Bytes { @param value The given integer @return The resulting `ByteArray` **/ - overload extern inline public static function from(value:Int):ByteArray { + overload extern public static inline function from(value:Int):ByteArray { var bytes = new ByteArray(4); bytes.setInt32(0, value); return bytes; } - overload extern inline public static function from(value:Int64):ByteArray { + overload extern public static inline function from(value:Int64):ByteArray { var bytes = new ByteArray(8); bytes.setInt64(0, value); return bytes; @@ -36,7 +35,7 @@ abstract ByteArray(Bytes) from Bytes to Bytes { @param value The given float @return The resulting `ByteArray` **/ - overload extern inline public static function from(value:Float):ByteArray { + overload extern public static inline function from(value:Float):ByteArray { var bytes = new ByteArray(8); bytes.setDouble(0, value); return bytes; @@ -46,7 +45,7 @@ abstract ByteArray(Bytes) from Bytes to Bytes { If `value` is `true`, generates a byte array of length 1, containing 1. If `value` is `false`, generates a byte array of length 1, containing 0. **/ - overload extern inline public static function from(value:Bool):ByteArray { + overload extern public static inline function from(value:Bool):ByteArray { return value ? new ByteArray(1, 1) : new ByteArray(1, 0); } @@ -54,10 +53,11 @@ abstract ByteArray(Bytes) from Bytes to Bytes { Encodes the given string into a byte array. `UTF-8` encoding is used by default. If you want to use another type of encoding, provide the second parameter. @param value The given string + @param encoding The encoding to use @return The resulting `ByteArray` **/ - overload extern inline public static function from(value:String, ?encoding:haxe.io.Encoding):ByteArray { - return Bytes.ofString(value); + overload extern public static inline function from(value:String, ?encoding:haxe.io.Encoding):ByteArray { + return Bytes.ofString(value, encoding); } /** @@ -66,14 +66,14 @@ abstract ByteArray(Bytes) from Bytes to Bytes { @param value The given object @return The resulting `ByteArray` **/ - overload extern inline public static function from(value:Dynamic):ByteArray { + overload extern public static inline function from(value:Dynamic):ByteArray { return Bytes.ofString(Serializer.run(value)); } /** Reads a byte at the specified index **/ - @:op([]) inline function read(index:Int) { + @:op([]) inline function read(index:Int):Int { return this.get(index); } @@ -160,10 +160,10 @@ abstract ByteArray(Bytes) from Bytes to Bytes { } /** - Concatenates a byte array to this one. **Pay Attention** - + Concatenates a byte array to this one. @param array the array to concatenate. - @return a new `ByteArray`. + @return a new `ByteArray`, containing the concatenation **/ public inline function concat(array:ByteArray):ByteArray { var newBytes = Bytes.alloc(this.length + array.length); diff --git a/src/vision/ds/Color.hx b/src/vision/ds/Color.hx index fa5b36c6..6ae7c42e 100644 --- a/src/vision/ds/Color.hx +++ b/src/vision/ds/Color.hx @@ -608,7 +608,7 @@ abstract Color(Int) from Int from UInt to Int to UInt { @param Value The channel value of the red, green & blue channels of the color @return The color as a `Color` **/ - public static inline function from8Bit(Value:Int) { + public static inline function from8Bit(Value:Int):Color { var color = new Color(); return color.setRGBA(Value, Value, Value, 1); } @@ -619,7 +619,7 @@ abstract Color(Int) from Int from UInt to Int to UInt { @param Value The channel value of the red, green & blue channels of the color @return The color as a `Color` **/ - public static inline function fromFloat(Value:Float) { + public static inline function fromFloat(Value:Float):Color { return fromRGBAFloat(Value, Value, Value, 1); } @@ -768,7 +768,7 @@ abstract Color(Int) from Int from UInt to Int to UInt { @param alphaLock When set to `false`, the alpha channel will get a randomized value to. `true` by default, which makes a color with `alpha = 255`. @param alphaValue When `alphaLock` is true, you can provide this value to override the default alpha value. Since the first argument is optional, you can do `Color.makeRandom(128)` (a random color with `alpha` set to `128`) **/ - public static inline function makeRandom(?alphaLock:Bool = true, alphaValue:Int = 255) { + public static inline function makeRandom(?alphaLock:Bool = true, alphaValue:Int = 255):Color { return Color.fromRGBAFloat(Math.random(), Math.random(), Math.random(), if (alphaLock) alphaValue else Math.random()); } @@ -826,7 +826,7 @@ abstract Color(Int) from Int from UInt to Int to UInt { return diff / (considerTransparency ? 2 : MathTools.SQRT3); } - public static inline function getAverage(fromColors:Array, considerTransparency:Bool = true) { + public static inline function getAverage(fromColors:Array, considerTransparency:Bool = true):Color { var reds = [], blues = [], greens = [], alphas = []; for (color in fromColors) { reds.push(color.redFloat); diff --git a/src/vision/ds/Image.hx b/src/vision/ds/Image.hx index bed62e6a..717b503b 100644 --- a/src/vision/ds/Image.hx +++ b/src/vision/ds/Image.hx @@ -1,12 +1,8 @@ package vision.ds; import vision.formats.ImageIO; -import vision.algorithms.GaussJordan; -import vision.ds.Matrix2D; -import haxe.Resource; import vision.ds.ByteArray; import vision.exceptions.Unimplemented; -import vision.tools.MathTools; import vision.algorithms.BilinearInterpolation; import haxe.ds.List; import haxe.Int64; @@ -15,7 +11,6 @@ import vision.exceptions.OutOfBounds; import vision.tools.ImageTools; using vision.tools.MathTools; using vision.tools.ArrayTools; -import vision.tools.MathTools.*; /** Represents a 2D image, as a matrix of Colors. @@ -1599,7 +1594,7 @@ abstract Image(ByteArray) { @param width The width of the returned image. @param height Optional, the height of the returned image. determined automatically, can be overridden by setting this parameter **/ - public static inline function loadFromBytes(bytes:ByteArray, width:Int, ?height:Int) { + public static inline function loadFromBytes(bytes:ByteArray, width:Int, ?height:Int):Image { var h = height != null ? height : (bytes.length / 4 / width).ceil(); var array = new ByteArray(width * h * 4 + OFFSET); array.fill(0, array.length, 0); @@ -1628,7 +1623,7 @@ abstract Image(ByteArray) { @param colorFormat The wanted color format of the returned `ByteArray`. @return A new `ByteArray` **/ - overload public extern inline function exportToBytes(?colorFormat:PixelFormat = ARGB) { + overload public extern inline function exportToBytes(?colorFormat:PixelFormat = ARGB):ByteArray { return inline PixelFormat.convertPixelFormat(underlying.sub(OFFSET, underlying.length - OFFSET), ARGB, colorFormat); } diff --git a/src/vision/ds/ImageFormat.hx b/src/vision/ds/ImageFormat.hx index 5a73a4d2..36303bda 100644 --- a/src/vision/ds/ImageFormat.hx +++ b/src/vision/ds/ImageFormat.hx @@ -25,7 +25,7 @@ enum abstract ImageFormat(Int) { **/ var VISION; - @:from public static function fromString(type:String) { + @:from public static function fromString(type:String):ImageFormat { return switch type.toLowerCase() { case "png": PNG; case "bmp": BMP; diff --git a/src/vision/ds/ImageView.hx b/src/vision/ds/ImageView.hx index 76e983f9..a8fb4ea7 100644 --- a/src/vision/ds/ImageView.hx +++ b/src/vision/ds/ImageView.hx @@ -25,7 +25,7 @@ class ImageView { **/ @:optional public var shape:ImageViewShape = RECTANGLE; - public function toString() { + public function toString():String { return '{shape: $shape, x: $x, y: $y, width: $width, height: $height}'; } } \ No newline at end of file diff --git a/src/vision/ds/IntPoint2D.hx b/src/vision/ds/IntPoint2D.hx index 5b22a9b1..1d57ea44 100644 --- a/src/vision/ds/IntPoint2D.hx +++ b/src/vision/ds/IntPoint2D.hx @@ -9,12 +9,12 @@ private typedef Impl = haxe.Int64; #else @:structInit private class Impl { - public var x:Int; - public var y:Int; + public var high:Int; + public var low:Int; public inline function new(x:Int, y:Int) { - this.x = x; - this.y = y; + high = x; + low = y; } } #end @@ -43,58 +43,42 @@ abstract IntPoint2D(Impl) { } inline function get_y() { - #if (((hl_ver >= version("1.12.0") && !hl_legacy32) || cpp || cs) && !vision_disable_point_alloc_optimization) return this.low; - #else - return this.y; - #end } inline function get_x() { - #if (((hl_ver >= version("1.12.0") && !hl_legacy32) || cpp || cs) && !vision_disable_point_alloc_optimization) return this.high; - #else - return this.x; - #end } inline function set_y(y:Int):Int { - #if (((hl_ver >= version("1.12.0") && !hl_legacy32) || cpp || cs) && !vision_disable_point_alloc_optimization) - this = Int64.make(x, y); - #else - this.y = y; - #end + this.low = y; return y; } - inline function set_x(x:Int) { - #if (((hl_ver >= version("1.12.0") && !hl_legacy32) || cpp || cs) && !vision_disable_point_alloc_optimization) - this = Int64.make(x, y); - #else - this.x = x; - #end + inline function set_x(x:Int):Int { + this.high = x; return x; } - @:to public inline function toPoint2D() { + @:to public inline function toPoint2D():Point2D { return new Point2D(x, y); } - @:from public static inline function fromPoint2D(p:Point2D) { + @:from public static inline function fromPoint2D(p:Point2D):IntPoint2D { return new IntPoint2D(Std.int(p.x), Std.int(p.y)); } /** Returns a `String` representations of this `IntPoint2D`. **/ - public inline function toString() { + public inline function toString():String { return '($x, $y)'; } /** Returns a new `IntPoint2D` instance, similar to this one. **/ - public inline function copy() { + public inline function copy():IntPoint2D { return new IntPoint2D(x, y); } diff --git a/src/vision/ds/Line2D.hx b/src/vision/ds/Line2D.hx index bdbf5e89..6317afa1 100644 --- a/src/vision/ds/Line2D.hx +++ b/src/vision/ds/Line2D.hx @@ -87,7 +87,7 @@ class Line2D { Returns a `String` representation of this `Line2D`. **/ @:keep - public inline function toString() { + public inline function toString():String { return '\n (${start.x}, ${start.y}) --> (${end.x}, ${end.y})'; } @@ -111,14 +111,14 @@ class Line2D { return new Ray2D(this.start, this.slope); } - inline function set_start(value:Point2D) { + inline function set_start(value:Point2D):Point2D { radians = MathTools.radiansFromPointToPoint2D(value, end); slope = MathTools.radiansToSlope(radians); degrees = MathTools.radiansToDegrees(radians); return start = value; } - inline function set_end(value:Point2D) { + inline function set_end(value:Point2D):Point2D { radians = MathTools.radiansFromPointToPoint2D(value, end); slope = MathTools.radiansToSlope(radians); degrees = MathTools.radiansToDegrees(radians); diff --git a/src/vision/ds/Matrix2D.hx b/src/vision/ds/Matrix2D.hx index f6b97bb2..a761844b 100644 --- a/src/vision/ds/Matrix2D.hx +++ b/src/vision/ds/Matrix2D.hx @@ -2,7 +2,6 @@ package vision.ds; import vision.algorithms.PerspectiveWarp; import vision.ds.specifics.PointTransformationPair; -import haxe.exceptions.NotImplementedException; import vision.exceptions.MatrixOperationError; import vision.algorithms.GaussJordan; import vision.ds.Array2D; @@ -329,7 +328,7 @@ abstract Matrix2D(Array2D) to Array2D from Array2D { @param pretty Whether to return a pretty-print of the matrix or not. A pretty print adds a distinct matrix border, centered numbers, and ellipsis where numbers are truncated. **/ - public inline function toString(precision:Int = 5, pretty:Bool = true) { + public inline function toString(precision:Int = 5, pretty:Bool = true):String { if (!pretty) return this.toString(); // Get the longest item, this will be the cell width @@ -519,7 +518,7 @@ abstract Matrix2D(Array2D) to Array2D from Array2D { @param z Displacement in pixels to the back. @param towards The point the graphic goes towards, as in, when `z` approaches positive infinity, the graphic goes towards that point. Defaults to `(0, 0)`. **/ - public static inline function DEPTH(z:Float, ?towards:Point2D) { + public static inline function DEPTH(z:Float, ?towards:Point2D):TransformationMatrix2D { return Matrix2D.createTransformation( [1, 0, towards != null ? towards.x * (z - 1) : 0], [0, 1, towards != null ? towards.y * (z - 1) : 0], @@ -658,7 +657,7 @@ abstract Matrix2D(Array2D) to Array2D from Array2D { return cast this; } - @:op(A += B) public inline function add(b:Matrix2D) { + @:op(A += B) public inline function add(b:Matrix2D):Matrix2D { if (rows != b.rows || columns != b.columns) { throw new MatrixOperationError("add", [this, b], Add_MismatchingDimensions); } @@ -672,7 +671,7 @@ abstract Matrix2D(Array2D) to Array2D from Array2D { return cast this; } - @:op(A -= B) public inline function subtract(b:Matrix2D) { + @:op(A -= B) public inline function subtract(b:Matrix2D):Matrix2D { if (rows != b.rows || columns != b.columns) { throw new MatrixOperationError("sub", [this, b], Sub_MismatchingDimensions); diff --git a/src/vision/ds/Point3D.hx b/src/vision/ds/Point3D.hx index 5a4747e1..93e3ba59 100644 --- a/src/vision/ds/Point3D.hx +++ b/src/vision/ds/Point3D.hx @@ -42,21 +42,21 @@ class Point3D { @param point The second point to calculate the distance to @return A `Float` representing the distance. `0` if `this` and `point` are congruent. **/ - public function distanceTo(point:Point3D) { + public function distanceTo(point:Point3D):Float { return MathTools.distanceBetweenPoints(this, point); } /** Returns a new `Point3D` instance, similar to this one. **/ - public function copy() { + public function copy():Point3D { return new Point3D(x, y, z); } /** Returns a `String` representations of this `Point3D`. **/ - public function toString() { + public function toString():String { return '($x, $y, $z)'; } } \ No newline at end of file diff --git a/src/vision/ds/Ray2D.hx b/src/vision/ds/Ray2D.hx index 953e9fa1..d6408539 100644 --- a/src/vision/ds/Ray2D.hx +++ b/src/vision/ds/Ray2D.hx @@ -68,7 +68,7 @@ class Ray2D { @param point1 First reference point, will be stored in the returned `Ray2D`'s `point` field. @param point2 Second reference point, used to calculate the slope of the ray. **/ - public static inline function from2Points(point1:Point2D, point2:Point2D) { + public static inline function from2Points(point1:Point2D, point2:Point2D):Ray2D { var s = (point2.y - point1.y) / (point2.x - point1.x); return new Ray2D(point1, s); } diff --git a/src/vision/formats/__internal/FormatImageLoader.hx b/src/vision/formats/__internal/FormatImageLoader.hx index aa14821c..9f1b79f0 100644 --- a/src/vision/formats/__internal/FormatImageLoader.hx +++ b/src/vision/formats/__internal/FormatImageLoader.hx @@ -51,7 +51,7 @@ class FormatImageLoader { @throws ImageLoadingFailed if the loaded image is not a BMP @throws ImageLoadingFailed if the BMP has incorrect header data, and reports it has more bytes than it should. **/ - public static function bmp(bytes:ByteArray) { + public static function bmp(bytes:ByteArray):Image { try { var reader = new BmpReader(new haxe.io.BytesInput(bytes)); var data = reader.read(); diff --git a/src/vision/helpers/VisionThread.hx b/src/vision/helpers/VisionThread.hx index 8af345db..7f8318d1 100644 --- a/src/vision/helpers/VisionThread.hx +++ b/src/vision/helpers/VisionThread.hx @@ -2,16 +2,11 @@ package vision.helpers; import vision.exceptions.MultithreadFailure; import haxe.Exception; -#if js -import js.lib.Promise; -#elseif (sys) -import sys.thread.Thread; -#end class VisionThread { static var COUNT:Int = 0; - var underlying:#if js Promise #elseif (target.threaded) Thread #else Dynamic #end; + var underlying:#if js js.lib.Promise #elseif (target.threaded) sys.thread.Thread #else Dynamic #end; /** * The currently assigned job. should be a function with 0 parameters and no return type (`Void` `->` `Void`) @@ -58,12 +53,12 @@ class VisionThread { public function start() { #if js - underlying = new Promise((onDone, onFailedWrapper) -> { + underlying = new js.lib.Promise((onDone, onFailedWrapper) -> { job(); jobDone = true; }); #elseif (sys) - underlying = Thread.create(() -> { + underlying = sys.thread.Thread.create(() -> { try { job(); jobDone = true; diff --git a/src/vision/tools/ArrayTools.hx b/src/vision/tools/ArrayTools.hx index a9e08794..cdc5ff17 100644 --- a/src/vision/tools/ArrayTools.hx +++ b/src/vision/tools/ArrayTools.hx @@ -27,7 +27,7 @@ class ArrayTools { @param delimiter The number of elements in each subarray @return An array of one higer dimension. **/ - overload extern inline public static function raise(array:Array, delimiter:Int):Array> { + overload extern public static inline function raise(array:Array, delimiter:Int):Array> { var raised = []; for (i in 0...array.length) { if (raised[floor(i / delimiter)] == null) raised[floor(i / delimiter)] = []; @@ -43,7 +43,7 @@ class ArrayTools { @param predicate A function that takes an element and returns true if the element should be used as a delimiter. @return An array of one higer dimension. **/ - overload extern inline public static function raise(array:Array, predicateOpensArray:Bool, predicate:T->Bool):Array> { + overload extern public static inline function raise(array:Array, predicateOpensArray:Bool, predicate:T->Bool):Array> { var raised:Array> = []; var temp:Array = []; @@ -60,7 +60,7 @@ class ArrayTools { return raised; } - public overload extern static inline function min>(values:Array):T { + overload extern public static inline function min>(values:Array):T { var min = values[0]; for (i in 0...values.length) { if ((values[i] - min) < 0) min = values[i]; @@ -68,7 +68,7 @@ class ArrayTools { return min; } - public overload extern static inline function min(values:Array):Int64 { + overload extern public static inline function min(values:Array):Int64 { var min = values[0]; for (i in 0...values.length) { if ((values[i] - min) < 0) min = values[i]; @@ -76,7 +76,7 @@ class ArrayTools { return min; } - public overload extern static inline function min(values:Array, valueFunction:T->Float):T { + overload extern public static inline function min(values:Array, valueFunction:T->Float):T { var min = values[0]; var minValue = valueFunction(min); for (i in 0...values.length) { @@ -90,7 +90,7 @@ class ArrayTools { return min; } - public overload extern static inline function max>(values:Array):T { + overload extern public static inline function max>(values:Array):T { var max = values[0]; for (i in 0...values.length) { if ((values[i] - max) > 0) max = values[i]; @@ -98,7 +98,7 @@ class ArrayTools { return max; } - public overload extern static inline function max(values:Array):Int64 { + overload extern public static inline function max(values:Array):Int64 { var max = values[0]; for (i in 0...values.length) { if ((values[i] - max) > 0) max = values[i]; @@ -106,7 +106,7 @@ class ArrayTools { return max; } - public overload extern static inline function max(values:Array, valueFunction:T->Float):T { + overload extern public static inline function max(values:Array, valueFunction:T->Float):T { var max = values[0]; var maxValue = valueFunction(max); for (i in 0...values.length) { @@ -120,7 +120,7 @@ class ArrayTools { return max; } - public overload extern static inline function average>(values:Array):Float { + overload extern public static inline function average>(values:Array):Float { var sum = 0.; for (v in values) { sum += cast v; @@ -128,7 +128,7 @@ class ArrayTools { return sum / values.length; } - public overload extern static inline function average(values:Array):Float { + overload extern public static inline function average(values:Array):Float { var sum = Int64.make(0, 0); for (v in values) { sum += v; diff --git a/src/vision/tools/ImageTools.hx b/src/vision/tools/ImageTools.hx index 7dd96581..4c65e757 100644 --- a/src/vision/tools/ImageTools.hx +++ b/src/vision/tools/ImageTools.hx @@ -71,7 +71,7 @@ class ImageTools { @throws WebResponseError Thrown when a file loading attempt from a URL fails. @throws Unimplemented Thrown when used with unsupported file types. **/ - public static overload extern inline function loadFromFile(?image:Image, path:String, ?onComplete:Image->Void) { + overload extern public static inline function loadFromFile(?image:Image, path:String, ?onComplete:Image->Void) { #if (!js) #if format var func:ByteArray -> Image; @@ -166,7 +166,7 @@ class ImageTools { return image; } - public static overload extern inline function loadFromFile(?image:Image, path:String):Image { + overload extern public static inline function loadFromFile(?image:Image, path:String):Image { #if js return image.copyImageFrom(JsImageLoader.loadFileSync(path)); #else @@ -209,7 +209,7 @@ class ImageTools { #end } - public static function exportToBytes(?image:Image, format:ImageFormat) { + public static function exportToBytes(?image:Image, format:ImageFormat):ByteArray { image = image == null ? new Image(0, 0) : image; return switch format { case VISION: image.underlying; diff --git a/src/vision/tools/MathTools.hx b/src/vision/tools/MathTools.hx index d1c52d80..6cd72eef 100644 --- a/src/vision/tools/MathTools.hx +++ b/src/vision/tools/MathTools.hx @@ -1,13 +1,8 @@ package vision.tools; -import haxe.ds.Either; import vision.ds.Point3D; -import vision.ds.Matrix2D; import vision.ds.IntPoint2D; -import haxe.ds.Vector; -import vision.algorithms.Radix; import haxe.Int64; -import haxe.ds.ArraySort; import vision.ds.Rectangle; import vision.ds.Ray2D; import vision.ds.Line2D; @@ -44,11 +39,11 @@ class MathTools { // Ray2D Extensions //----------------------------------------------------------------------------------------- - public static inline function distanceFromRayToPoint2D(ray:Ray2D, point:Point2D) { + public static inline function distanceFromRayToPoint2D(ray:Ray2D, point:Point2D):Float { return distanceFromPointToRay2D(point, ray); } - public inline static function intersectionBetweenRay2Ds(ray:Ray2D, ray2:Ray2D):Point2D { + public static inline function intersectionBetweenRay2Ds(ray:Ray2D, ray2:Ray2D):Point2D { final line1StartX = ray.point.x; final line1StartY = ray.point.y; final line1EndX = ray.point.x + cos(ray.radians) * 1000; @@ -223,7 +218,7 @@ class MathTools { // Point2D Extensions //----------------------------------------------------------------------------------------- - overload extern inline public static function distanceFromPointToRay2D(point:Point2D, ray:Ray2D):Float { + overload extern public static inline function distanceFromPointToRay2D(point:Point2D, ray:Ray2D):Float { // Get the closest point on the ray to the given point final closestPoint:Point2D = getClosestPointOnRay2D(point, ray); @@ -235,7 +230,7 @@ class MathTools { return distance; } - overload extern inline public static function distanceFromPointToLine2D(point:Point2D, line:Line2D):Float { + overload extern public static inline function distanceFromPointToLine2D(point:Point2D, line:Line2D):Float { final middle = new Point2D(line.end.x - line.start.x, line.end.y - line.start.y); final denominator = middle.x * middle.x + middle.y * middle.y; var ratio = ((point.x - line.start.x) * middle.x + (point.y - line.start.y) * middle.y) / denominator; @@ -252,53 +247,53 @@ class MathTools { return sqrt(dx * dx + dy * dy); } - overload extern inline public static function radiansFromPointToLine2D(point:Point2D, line:Line2D):Float { + overload extern public static inline function radiansFromPointToLine2D(point:Point2D, line:Line2D):Float { final angle:Float = atan2(line.end.y - line.start.y, line.end.x - line.start.x); final angle2:Float = atan2(point.y - line.start.y, point.x - line.start.x); return angle2 - angle; } - overload extern inline public static function radiansFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { + overload extern public static inline function radiansFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return atan2(y, x); } - overload extern inline public static function degreesFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { + overload extern public static inline function degreesFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { return radiansToDegrees(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function slopeFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { + overload extern public static inline function slopeFromPointToPoint2D(point1:Point2D, point2:Point2D):Float { return radiansToSlope(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function distanceBetweenPoints(point1:Point2D, point2:Point2D):Float { + overload extern public static inline function distanceBetweenPoints(point1:Point2D, point2:Point2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return sqrt(x * x + y * y); } - overload extern inline public static function radiansFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { + overload extern public static inline function radiansFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return atan2(y, x); } - overload extern inline public static function degreesFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { + overload extern public static inline function degreesFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { return radiansToDegrees(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function slopeFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { + overload extern public static inline function slopeFromPointToPoint2D(point1:Point2D, point2:IntPoint2D):Float { return radiansToSlope(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function distanceBetweenPoints(point1:Point2D, point2:IntPoint2D):Float { + overload extern public static inline function distanceBetweenPoints(point1:Point2D, point2:IntPoint2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return sqrt(x * x + y * y); } - overload extern inline public static function getClosestPointOnRay2D(point:Point2D, ray:Ray2D):Point2D { + overload extern public static inline function getClosestPointOnRay2D(point:Point2D, ray:Ray2D):Point2D { // Vector from the origin of the ray to the given point var vx:Float = point.x - ray.point.x; var vy:Float = point.y - ray.point.y; @@ -317,7 +312,7 @@ class MathTools { // IntPoint2D Extensions //----------------------------------------------------------------------------------------- - overload extern inline public static function distanceFromPointToRay2D(point:IntPoint2D, ray:Ray2D):Float { + overload extern public static inline function distanceFromPointToRay2D(point:IntPoint2D, ray:Ray2D):Float { // Get the closest point on the ray to the given point final closestPoint:Point2D = getClosestPointOnRay2D(point, ray); @@ -329,7 +324,7 @@ class MathTools { return distance; } - overload extern inline public static function distanceFromPointToLine2D(point:IntPoint2D, line:Line2D):Float { + overload extern public static inline function distanceFromPointToLine2D(point:IntPoint2D, line:Line2D):Float { final middle = new Point2D(line.end.x - line.start.x, line.end.y - line.start.y); final denominator = middle.x * middle.x + middle.y * middle.y; var ratio = ((point.x - line.start.x) * middle.x + (point.y - line.start.y) * middle.y) / denominator; @@ -346,53 +341,53 @@ class MathTools { return sqrt(dx * dx + dy * dy); } - overload extern inline public static function radiansFromPointToLine2D(point:IntPoint2D, line:Line2D):Float { + overload extern public static inline function radiansFromPointToLine2D(point:IntPoint2D, line:Line2D):Float { final angle:Float = atan2(line.end.y - line.start.y, line.end.x - line.start.x); final angle2:Float = atan2(point.y - line.start.y, point.x - line.start.x); return angle2 - angle; } - overload extern inline public static function radiansFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { + overload extern public static inline function radiansFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return atan2(y, x); } - overload extern inline public static function degreesFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { + overload extern public static inline function degreesFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { return radiansToDegrees(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function slopeFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { + overload extern public static inline function slopeFromPointToPoint2D(point1:IntPoint2D, point2:IntPoint2D):Float { return radiansToSlope(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function distanceBetweenPoints(point1:IntPoint2D, point2:IntPoint2D):Float { + overload extern public static inline function distanceBetweenPoints(point1:IntPoint2D, point2:IntPoint2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return sqrt(x * x + y * y); } - overload extern inline public static function radiansFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { + overload extern public static inline function radiansFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return atan2(y, x); } - overload extern inline public static function degreesFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { + overload extern public static inline function degreesFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { return radiansToDegrees(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function slopeFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { + overload extern public static inline function slopeFromPointToPoint2D(point1:IntPoint2D, point2:Point2D):Float { return radiansToSlope(radiansFromPointToPoint2D(point1, point2)); } - overload extern inline public static function distanceBetweenPoints(point1:IntPoint2D, point2:Point2D):Float { + overload extern public static inline function distanceBetweenPoints(point1:IntPoint2D, point2:Point2D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; return sqrt(x * x + y * y); } - overload extern inline public static function getClosestPointOnRay2D(point:IntPoint2D, ray:Ray2D):Point2D { + overload extern public static inline function getClosestPointOnRay2D(point:IntPoint2D, ray:Ray2D):Point2D { // Vector from the origin of the ray to the given point var vx:Float = point.x - ray.point.x; var vy:Float = point.y - ray.point.y; @@ -411,7 +406,7 @@ class MathTools { // Point3D //----------------------------------------------------------------------------- - overload extern inline public static function distanceBetweenPoints(point1:Point3D, point2:Point3D):Float { + overload extern public static inline function distanceBetweenPoints(point1:Point3D, point2:Point3D):Float { final x:Float = point2.x - point1.x; final y:Float = point2.y - point1.y; final z:Float = point2.z - point1.z; @@ -448,7 +443,7 @@ class MathTools { Ensures that the value is between min and max, by wrapping the value around when it is outside of the range. **/ - public inline static function wrapInt(value:Int, min:Int, max:Int):Int { + public static inline function wrapInt(value:Int, min:Int, max:Int):Int { var range = max - min + 1; if (value < min) value += range * Std.int((min - value) / range + 1); @@ -460,7 +455,7 @@ class MathTools { Ensures that the value is between min and max, by wrapping the value around when it is outside of the range. **/ - public inline static function wrapFloat(value:Float, min:Float, max:Float):Float { + public static inline function wrapFloat(value:Float, min:Float, max:Float):Float { var range = max - min; if (value < min) value += range * (min - value) / range + 1; @@ -610,28 +605,28 @@ class MathTools { // Utilities For Number Arrays //----------------------------------------------------------------------------------------- - overload extern inline public static function max(value:Int, ...values:Int) return ArrayTools.max(values.toArray().concat([value])); - overload extern inline public static function max(value:Float, ...values:Float) return ArrayTools.max(values.toArray().concat([value])); - overload extern inline public static function max(value:Int64, ...values:Int64) return ArrayTools.max(values.toArray().concat([value])); + overload extern public static inline function max(value:Int, ...values:Int):Int return ArrayTools.max(values.toArray().concat([value])); + overload extern public static inline function max(value:Float, ...values:Float):Float return ArrayTools.max(values.toArray().concat([value])); + overload extern public static inline function max(value:Int64, ...values:Int64):Int64 return ArrayTools.max(values.toArray().concat([value])); - overload extern inline public static function min(value:Int, ...values:Int) return ArrayTools.min(values.toArray().concat([value])); - overload extern inline public static function min(value:Float, ...values:Float) return ArrayTools.min(values.toArray().concat([value])); - overload extern inline public static function min(value:Int64, ...values:Int64) return ArrayTools.min(values.toArray().concat([value])); + overload extern public static inline function min(value:Int, ...values:Int):Int return ArrayTools.min(values.toArray().concat([value])); + overload extern public static inline function min(value:Float, ...values:Float):Float return ArrayTools.min(values.toArray().concat([value])); + overload extern public static inline function min(value:Int64, ...values:Int64):Int64 return ArrayTools.min(values.toArray().concat([value])); - overload extern inline public static function average(value:Int, ...values:Int) return ArrayTools.average(values.toArray().concat([value])); - overload extern inline public static function average(value:Float, ...values:Float) return ArrayTools.average(values.toArray().concat([value])); - overload extern inline public static function average(value:Int64, ...values:Int64) return ArrayTools.average(values.toArray().concat([value])); + overload extern public static inline function average(value:Int, ...values:Int):Float return ArrayTools.average(values.toArray().concat([value])); + overload extern public static inline function average(value:Float, ...values:Float):Float return ArrayTools.average(values.toArray().concat([value])); + overload extern public static inline function average(value:Int64, ...values:Int64):Float return ArrayTools.average(values.toArray().concat([value])); - overload extern inline public static function median(value:Int, ...values:Int) return ArrayTools.median(values.toArray().concat([value])); - overload extern inline public static function median(value:Float, ...values:Float) return ArrayTools.median(values.toArray().concat([value])); - overload extern inline public static function median(value:Int64, ...values:Int64) return ArrayTools.median(values.toArray().concat([value])); + overload extern public static inline function median(value:Int, ...values:Int):Int return ArrayTools.median(values.toArray().concat([value])); + overload extern public static inline function median(value:Float, ...values:Float):Float return ArrayTools.median(values.toArray().concat([value])); + overload extern public static inline function median(value:Int64, ...values:Int64):Int64 return ArrayTools.median(values.toArray().concat([value])); // ---------------------------------------------------------------------------------------- // Utilities For Number Types // ---------------------------------------------------------------------------------------- - public static inline function isInt(v:Float) { + public static inline function isInt(v:Float):Bool { return v == Std.int(v); } From a608a43d80f84bfc784e3bbb960e95bc417d3ded Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Mon, 9 Jun 2025 00:20:45 +0300 Subject: [PATCH 23/32] Basically all unit tests generated, also improved generator + detector to work with overloads and void methods --- src/vision/ds/ImageView.hx | 2 + src/vision/ds/TransformationMatrix2D.hx | 1 + tests/config.json | 12 +- tests/generated/src/TestsToRun.hx | 9 + tests/generated/src/tests/Array2DTests.hx | 263 +++ tests/generated/src/tests/ArrayToolsTests.hx | 167 +- .../src/tests/BilateralFilterTests.hx | 2 +- .../src/tests/BilinearInterpolationTests.hx | 26 +- tests/generated/src/tests/ByteArrayTests.hx | 391 ++++ tests/generated/src/tests/CannyTests.hx | 34 +- tests/generated/src/tests/ColorTests.hx | 1245 ++--------- tests/generated/src/tests/CramerTests.hx | 22 +- .../src/tests/FormatImageExporterTests.hx | 14 +- .../src/tests/FormatImageLoaderTests.hx | 4 +- tests/generated/src/tests/GaussJordanTests.hx | 84 +- tests/generated/src/tests/GaussTests.hx | 142 +- tests/generated/src/tests/HistogramTests.hx | 4 +- .../generated/src/tests/ImageHashingTests.hx | 16 +- tests/generated/src/tests/ImageTests.hx | 1891 +++++++++++++++++ tests/generated/src/tests/ImageViewTests.hx | 31 + .../generated/src/tests/Int16Point2DTests.hx | 8 +- tests/generated/src/tests/IntPoint2DTests.hx | 36 +- tests/generated/src/tests/KMeansTests.hx | 60 + tests/generated/src/tests/LaplaceTests.hx | 18 +- tests/generated/src/tests/Line2DTests.hx | 38 +- tests/generated/src/tests/MathToolsTests.hx | 844 +++----- tests/generated/src/tests/Matrix2DTests.hx | 807 +++++++ .../src/tests/PerspectiveWarpTests.hx | 2 +- tests/generated/src/tests/PerwittTests.hx | 14 +- tests/generated/src/tests/Point2DTests.hx | 24 +- tests/generated/src/tests/Point3DTests.hx | 24 +- tests/generated/src/tests/QueueCellTests.hx | 34 + tests/generated/src/tests/QueueTests.hx | 43 +- tests/generated/src/tests/RadixTests.hx | 38 +- tests/generated/src/tests/Ray2DTests.hx | 22 +- .../generated/src/tests/RobertsCrossTests.hx | 2 +- tests/generated/src/tests/SimpleHoughTests.hx | 21 +- .../src/tests/SimpleLineDetectorTests.hx | 29 +- tests/generated/src/tests/SobelTests.hx | 14 +- .../src/tests/TransformationMatrix2DTests.hx | 226 ++ .../generated/src/tests/UInt16Point2DTests.hx | 8 +- tests/generated/src/tests/VisionTests.hx | 425 ++-- .../generated/src/tests/VisionThreadTests.hx | 51 + tests/generator/Detector.hx | 28 +- tests/generator/Generator.hx | 41 +- 45 files changed, 5126 insertions(+), 2091 deletions(-) create mode 100644 tests/generated/src/tests/Array2DTests.hx create mode 100644 tests/generated/src/tests/ByteArrayTests.hx create mode 100644 tests/generated/src/tests/ImageTests.hx create mode 100644 tests/generated/src/tests/ImageViewTests.hx create mode 100644 tests/generated/src/tests/Matrix2DTests.hx create mode 100644 tests/generated/src/tests/QueueCellTests.hx create mode 100644 tests/generated/src/tests/TransformationMatrix2DTests.hx create mode 100644 tests/generated/src/tests/VisionThreadTests.hx diff --git a/src/vision/ds/ImageView.hx b/src/vision/ds/ImageView.hx index a8fb4ea7..734a938b 100644 --- a/src/vision/ds/ImageView.hx +++ b/src/vision/ds/ImageView.hx @@ -1,5 +1,7 @@ package vision.ds; +import vision.ds.ImageViewShape; + @:structInit class ImageView { /** diff --git a/src/vision/ds/TransformationMatrix2D.hx b/src/vision/ds/TransformationMatrix2D.hx index f48d5257..a4cc1e24 100644 --- a/src/vision/ds/TransformationMatrix2D.hx +++ b/src/vision/ds/TransformationMatrix2D.hx @@ -1,6 +1,7 @@ package vision.ds; import vision.ds.Matrix2D; +import vision.ds.Point3D; @:forward.variance @:forward(getRow, getColumn, setRow, setColumn, map, clone, fill, toString) diff --git a/tests/config.json b/tests/config.json index 7e25db22..06d23c5e 100644 --- a/tests/config.json +++ b/tests/config.json @@ -1,20 +1,12 @@ { "regenerateAll": true, - "overwrite": true, + "overwrite": false, "source": "../src/vision", "exclude": [ "exceptions/", - "VisionThread.hx", - "Matrix2D.hx", - "ImageView.hx", - "Image.hx", - "ImageTools.hx", "Array2DMacro.hx", "FrameworkImageIO.hx", - "ByteArray.hx", - "QueueCell.hx", - "Array2D.hx", - "GaussJordan.hx" + "ImageTools.hx" ], "destination": "./generated/src/tests", "testsToRunFile": "./generated/src/TestsToRun.hx" diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index f9ff7ee7..2b1bdae9 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -8,6 +8,7 @@ final tests:Array> = [ CannyTests, CramerTests, GaussTests, + GaussJordanTests, ImageHashingTests, KMeansTests, LaplaceTests, @@ -18,24 +19,32 @@ final tests:Array> = [ SimpleHoughTests, SimpleLineDetectorTests, SobelTests, + Array2DTests, + ByteArrayTests, CannyObjectTests, ColorTests, HistogramTests, + ImageTests, + ImageViewTests, Int16Point2DTests, IntPoint2DTests, ColorClusterTests, Line2DTests, + Matrix2DTests, PixelTests, Point2DTests, Point3DTests, QueueTests, + QueueCellTests, Ray2DTests, RectangleTests, PointTransformationPairTests, + TransformationMatrix2DTests, UInt16Point2DTests, ImageIOTests, FormatImageExporterTests, FormatImageLoaderTests, + VisionThreadTests, ArrayToolsTests, MathToolsTests, VisionTests diff --git a/tests/generated/src/tests/Array2DTests.hx b/tests/generated/src/tests/Array2DTests.hx new file mode 100644 index 00000000..47a6cc45 --- /dev/null +++ b/tests/generated/src/tests/Array2DTests.hx @@ -0,0 +1,263 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Array2D; +import haxe.iterators.ArrayIterator; + +@:access(vision.ds.Array2D) +class Array2DTests { + public static function vision_ds_Array2D__length__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.length; + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#length", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__get_Int_Int_T__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var x = 0; + var y = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.get(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#get", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__set__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var x = 0; + var y = 0; + var val = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + object.set(x, y, val); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#set", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__setMultiple__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var points = []; + var val = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + object.setMultiple(points, val); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#setMultiple", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__row_Int_ArrayT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var y = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.row(y); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#row", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__column_Int_ArrayT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var x = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.column(x); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#column", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__iterator__ArrayIteratorT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.iterator(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#iterator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__fill_T_Array2DT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + var value = 0; + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.fill(value); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#fill", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__clone__Array2DT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.clone(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#clone", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__toString__String__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Array2D__to2DArray__ArrayArrayT__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var fillWith = 0; + + + var object = new vision.ds.Array2D(width, height, fillWith); + result = object.to2DArray(); + } catch (e) { + + } + + return { + testName: "vision.ds.Array2D#to2DArray", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/ArrayToolsTests.hx b/tests/generated/src/tests/ArrayToolsTests.hx index d74020e7..d895c46b 100644 --- a/tests/generated/src/tests/ArrayToolsTests.hx +++ b/tests/generated/src/tests/ArrayToolsTests.hx @@ -12,7 +12,82 @@ import vision.tools.MathTools.*; @:access(vision.tools.ArrayTools) class ArrayToolsTests { - public static function vision_tools_ArrayTools__min__ShouldWork():TestResult { + public static function vision_tools_ArrayTools__flatten_Array_ArrayT__ShouldWork():TestResult { + var result = null; + try { + var array = []; + + result = vision.tools.ArrayTools.flatten(array); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.flatten", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__raise_ArrayT_Int_ArrayArrayT__ShouldWork():TestResult { + var result = null; + try { + var array = []; + var delimiter = 0; + + result = vision.tools.ArrayTools.raise(array, delimiter); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.raise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__raise_ArrayT_Bool_TBool_ArrayArrayT__ShouldWork():TestResult { + var result = null; + try { + var array = []; + var predicateOpensArray = false; + var predicate = (_) -> null; + + result = vision.tools.ArrayTools.raise(array, predicateOpensArray, predicate); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.raise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__min_ArrayInt64_Int64__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.min(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.min", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__min_ArrayT_TFloat_T__ShouldWork():TestResult { var result = null; try { var values = []; @@ -31,25 +106,25 @@ class ArrayToolsTests { } } - public static function vision_tools_ArrayTools__median__ShouldWork():TestResult { + public static function vision_tools_ArrayTools__max_ArrayInt64_Int64__ShouldWork():TestResult { var result = null; try { var values = []; - result = vision.tools.ArrayTools.median(values); + result = vision.tools.ArrayTools.max(values); } catch (e) { } return { - testName: "vision.tools.ArrayTools.median", + testName: "vision.tools.ArrayTools.max", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_ArrayTools__max__ShouldWork():TestResult { + public static function vision_tools_ArrayTools__max_ArrayT_TFloat_T__ShouldWork():TestResult { var result = null; try { var values = []; @@ -68,6 +143,78 @@ class ArrayToolsTests { } } + public static function vision_tools_ArrayTools__average_ArrayInt64_Float__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.average(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.average", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__median_ArrayInt_Int__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.median(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__median_ArrayInt64_Int64__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.median(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_tools_ArrayTools__median_ArrayFloat_Float__ShouldWork():TestResult { + var result = null; + try { + var values = []; + + result = vision.tools.ArrayTools.median(values); + } catch (e) { + + } + + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: null, + status: Unimplemented + } + } + public static function vision_tools_ArrayTools__distanceTo__ShouldWork():TestResult { var result = null; try { @@ -75,7 +222,7 @@ class ArrayToolsTests { var to = []; var distanceFunction = (_, _) -> null; - result = vision.tools.ArrayTools.distanceTo(array, to, distanceFunction); + vision.tools.ArrayTools.distanceTo(array, to, distanceFunction); } catch (e) { } @@ -88,18 +235,18 @@ class ArrayToolsTests { } } - public static function vision_tools_ArrayTools__average__ShouldWork():TestResult { + public static function vision_tools_ArrayTools__distinct_ArrayT_ArrayT__ShouldWork():TestResult { var result = null; try { - var values = []; + var array = []; - result = vision.tools.ArrayTools.average(values); + result = vision.tools.ArrayTools.distinct(array); } catch (e) { } return { - testName: "vision.tools.ArrayTools.average", + testName: "vision.tools.ArrayTools.distinct", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/BilateralFilterTests.hx b/tests/generated/src/tests/BilateralFilterTests.hx index 4659c08a..5c0bff08 100644 --- a/tests/generated/src/tests/BilateralFilterTests.hx +++ b/tests/generated/src/tests/BilateralFilterTests.hx @@ -11,7 +11,7 @@ import vision.ds.Image; @:access(vision.algorithms.BilateralFilter) class BilateralFilterTests { - public static function vision_algorithms_BilateralFilter__filter__ShouldWork():TestResult { + public static function vision_algorithms_BilateralFilter__filter_Image_Float_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); diff --git a/tests/generated/src/tests/BilinearInterpolationTests.hx b/tests/generated/src/tests/BilinearInterpolationTests.hx index 25d67f37..7efeec05 100644 --- a/tests/generated/src/tests/BilinearInterpolationTests.hx +++ b/tests/generated/src/tests/BilinearInterpolationTests.hx @@ -5,49 +5,47 @@ import TestStatus; import vision.algorithms.BilinearInterpolation; import vision.ds.Color; -import vision.tools.ImageTools; -import vision.exceptions.OutOfBounds; import vision.ds.Image; import vision.tools.MathTools.*; @:access(vision.algorithms.BilinearInterpolation) class BilinearInterpolationTests { - public static function vision_algorithms_BilinearInterpolation__interpolateMissingPixels__ShouldWork():TestResult { + public static function vision_algorithms_BilinearInterpolation__interpolate_Image_Int_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var kernelRadiusX = 0; - var kernelRadiusY = 0; - var minX = 0; - var minY = 0; + var width = 0; + var height = 0; - result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels(image, kernelRadiusX, kernelRadiusY, minX, minY); + result = vision.algorithms.BilinearInterpolation.interpolate(image, width, height); } catch (e) { } return { - testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", + testName: "vision.algorithms.BilinearInterpolation.interpolate", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_BilinearInterpolation__interpolate__ShouldWork():TestResult { + public static function vision_algorithms_BilinearInterpolation__interpolateMissingPixels_Image_Int_Int_Int_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var width = 0; - var height = 0; + var kernelRadiusX = 0; + var kernelRadiusY = 0; + var minX = 0; + var minY = 0; - result = vision.algorithms.BilinearInterpolation.interpolate(image, width, height); + result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels(image, kernelRadiusX, kernelRadiusY, minX, minY); } catch (e) { } return { - testName: "vision.algorithms.BilinearInterpolation.interpolate", + testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx new file mode 100644 index 00000000..c221e87c --- /dev/null +++ b/tests/generated/src/tests/ByteArrayTests.hx @@ -0,0 +1,391 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.ByteArray; +import haxe.Int64; +import vision.tools.MathTools; +import haxe.Serializer; +import haxe.io.Bytes; + +@:access(vision.ds.ByteArray) +class ByteArrayTests { + public static function vision_ds_ByteArray__from_Int_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value = 0; + + result = vision.ds.ByteArray.from(value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__from_Int64_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value:Int64 = null; + + result = vision.ds.ByteArray.from(value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__from_Float_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value = 0.0; + + result = vision.ds.ByteArray.from(value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__from_Bool_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value = false; + + result = vision.ds.ByteArray.from(value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__from_String_haxeioEncoding_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value = ""; + var encoding:haxe.io.Encoding = null; + + result = vision.ds.ByteArray.from(value, encoding); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__from_Dynamic_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var value:Dynamic = null; + + result = vision.ds.ByteArray.from(value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setUInt8__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + var v = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + object.setUInt8(pos, v); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setUInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getUInt8_Int_Int__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.getUInt8(pos); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getUInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setUInt32__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + var value:UInt = null; + + var object = new vision.ds.ByteArray(length, fillWith); + object.setUInt32(pos, value); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setUInt32", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getUInt32_Int_UInt__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.getUInt32(pos); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getUInt32", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setInt8__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + var v = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + object.setInt8(pos, v); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getInt8_Int_Int__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.getInt8(pos); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getInt8", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__setBytes__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + var array = vision.ds.ByteArray.from(0); + + var object = new vision.ds.ByteArray(length, fillWith); + object.setBytes(pos, array); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#setBytes", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__getBytes_Int_Int_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var pos = 0; + var length = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.getBytes(pos, length); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#getBytes", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__resize__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var length = 0; + + var object = new vision.ds.ByteArray(length, fillWith); + object.resize(length); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#resize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__concat_ByteArray_ByteArray__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + var array = vision.ds.ByteArray.from(0); + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.concat(array); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#concat", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__isEmpty__Bool__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.isEmpty(); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#isEmpty", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_ByteArray__toArray__ArrayInt__ShouldWork():TestResult { + var result = null; + try { + var length = 0; + var fillWith = 0; + + + var object = new vision.ds.ByteArray(length, fillWith); + result = object.toArray(); + } catch (e) { + + } + + return { + testName: "vision.ds.ByteArray#toArray", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/CannyTests.hx b/tests/generated/src/tests/CannyTests.hx index 05172615..689c39ba 100644 --- a/tests/generated/src/tests/CannyTests.hx +++ b/tests/generated/src/tests/CannyTests.hx @@ -10,43 +10,45 @@ import vision.ds.canny.CannyObject; @:access(vision.algorithms.Canny) class CannyTests { - public static function vision_algorithms_Canny__nonMaxSuppression__ShouldWork():TestResult { + public static function vision_algorithms_Canny__grayscale_CannyObject_CannyObject__ShouldWork():TestResult { var result = null; try { var image:CannyObject = null; - result = vision.algorithms.Canny.nonMaxSuppression(image); + result = vision.algorithms.Canny.grayscale(image); } catch (e) { } return { - testName: "vision.algorithms.Canny.nonMaxSuppression", + testName: "vision.algorithms.Canny.grayscale", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Canny__grayscale__ShouldWork():TestResult { + public static function vision_algorithms_Canny__applyGaussian_CannyObject_Int_Float_CannyObject__ShouldWork():TestResult { var result = null; try { var image:CannyObject = null; + var size = 0; + var sigma = 0.0; - result = vision.algorithms.Canny.grayscale(image); + result = vision.algorithms.Canny.applyGaussian(image, size, sigma); } catch (e) { } return { - testName: "vision.algorithms.Canny.grayscale", + testName: "vision.algorithms.Canny.applyGaussian", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Canny__applySobelFilters__ShouldWork():TestResult { + public static function vision_algorithms_Canny__applySobelFilters_CannyObject_CannyObject__ShouldWork():TestResult { var result = null; try { var image:CannyObject = null; @@ -64,40 +66,38 @@ class CannyTests { } } - public static function vision_algorithms_Canny__applyHysteresis__ShouldWork():TestResult { + public static function vision_algorithms_Canny__nonMaxSuppression_CannyObject_CannyObject__ShouldWork():TestResult { var result = null; try { var image:CannyObject = null; - var highThreshold = 0.0; - var lowThreshold = 0.0; - result = vision.algorithms.Canny.applyHysteresis(image, highThreshold, lowThreshold); + result = vision.algorithms.Canny.nonMaxSuppression(image); } catch (e) { } return { - testName: "vision.algorithms.Canny.applyHysteresis", + testName: "vision.algorithms.Canny.nonMaxSuppression", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Canny__applyGaussian__ShouldWork():TestResult { + public static function vision_algorithms_Canny__applyHysteresis_CannyObject_Float_Float_CannyObject__ShouldWork():TestResult { var result = null; try { var image:CannyObject = null; - var size = 0; - var sigma = 0.0; + var highThreshold = 0.0; + var lowThreshold = 0.0; - result = vision.algorithms.Canny.applyGaussian(image, size, sigma); + result = vision.algorithms.Canny.applyHysteresis(image, highThreshold, lowThreshold); } catch (e) { } return { - testName: "vision.algorithms.Canny.applyGaussian", + testName: "vision.algorithms.Canny.applyHysteresis", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index 02b9a609..a09a7643 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -332,1335 +332,480 @@ class ColorTests { } } - public static function vision_ds_Color__subtract__ShouldWork():TestResult { + public static function vision_ds_Color__fromInt_Int_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.subtract(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.subtract", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__multiply__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.multiply(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.multiply", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__makeRandom__ShouldWork():TestResult { - var result = null; - try { - var alphaLock = false; - var alphaValue = 0; - - result = vision.ds.Color.makeRandom(alphaLock, alphaValue); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.makeRandom", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__interpolate__ShouldWork():TestResult { - var result = null; - try { - var Color1:Color = null; - var Color2:Color = null; - var Factor = 0.0; - - result = vision.ds.Color.interpolate(Color1, Color2, Factor); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.interpolate", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_not_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_not_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_not_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_less_than_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_less_than_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_less_than_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_less_than_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_less_than_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_less_than_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_greater_than_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_greater_than_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_greater_than_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_greater_than_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_greater_than_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_greater_than_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_xor_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_xor_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_xor_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_unsigned_right_shift_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_unsigned_right_shift_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_unsigned_right_shift_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_right_shift_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_right_shift_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_right_shift_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_or_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_or_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_or_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_left_shift_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_left_shift_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_left_shift_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__int_bitwise_and_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0; - var rhs:Color = null; - - result = vision.ds.Color.int_bitwise_and_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.int_bitwise_and_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__getAverage__ShouldWork():TestResult { - var result = null; - try { - var fromColors = []; - var considerTransparency = false; - - result = vision.ds.Color.getAverage(fromColors, considerTransparency); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.getAverage", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromRGBAFloat__ShouldWork():TestResult { - var result = null; - try { - var Red = 0.0; - var Green = 0.0; - var Blue = 0.0; - var Alpha = 0.0; - - result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromRGBAFloat", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromRGBA__ShouldWork():TestResult { - var result = null; - try { - var Red = 0; - var Green = 0; - var Blue = 0; - var Alpha = 0; - - result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromRGBA", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromInt__ShouldWork():TestResult { - var result = null; - try { - var value = 0; - - result = vision.ds.Color.fromInt(value); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromInt", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromHSL__ShouldWork():TestResult { - var result = null; - try { - var Hue = 0.0; - var Saturation = 0.0; - var Lightness = 0.0; - var Alpha = 0.0; - - result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromHSL", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromHSB__ShouldWork():TestResult { - var result = null; - try { - var Hue = 0.0; - var Saturation = 0.0; - var Brightness = 0.0; - var Alpha = 0.0; - - result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromHSB", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromFloat__ShouldWork():TestResult { - var result = null; - try { - var Value = 0.0; - - result = vision.ds.Color.fromFloat(Value); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromFloat", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__fromCMYK__ShouldWork():TestResult { - var result = null; - try { - var Cyan = 0.0; - var Magenta = 0.0; - var Yellow = 0.0; - var Black = 0.0; - var Alpha = 0.0; - - result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.fromCMYK", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__from8Bit__ShouldWork():TestResult { - var result = null; - try { - var Value = 0; - - result = vision.ds.Color.from8Bit(Value); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.from8Bit", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_not_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_not_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_not_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_less_than_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_less_than_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_less_than_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_less_than_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_less_than_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_less_than_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_greater_than_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_greater_than_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_greater_than_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_greater_than_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_greater_than_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_greater_than_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__float_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs = 0.0; - var rhs:Color = null; - - result = vision.ds.Color.float_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.float_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__divide__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.divide(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.divide", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__distanceBetween__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - var considerTransparency = false; - - result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.distanceBetween", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__differenceBetween__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - var considerTransparency = false; - - result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.differenceBetween", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_not_equal_int__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0; - - result = vision.ds.Color.color_not_equal_int(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_not_equal_int", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_not_equal_float__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0.0; - - result = vision.ds.Color.color_not_equal_float(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_not_equal_float", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_not_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.color_not_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_not_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_int__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0; - - result = vision.ds.Color.color_less_than_int(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_int", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_float__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0.0; - - result = vision.ds.Color.color_less_than_float(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_float", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_equal_int__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0; - - result = vision.ds.Color.color_less_than_equal_int(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_equal_int", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_equal_float__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0.0; - - result = vision.ds.Color.color_less_than_equal_float(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_equal_float", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_equal_color__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.color_less_than_equal_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_equal_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_less_than_color__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs:Color = null; - - result = vision.ds.Color.color_less_than_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_less_than_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_greater_than_int__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0; - - result = vision.ds.Color.color_greater_than_int(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_greater_than_int", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_greater_than_float__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0.0; + var value = 0; - result = vision.ds.Color.color_greater_than_float(lhs, rhs); + result = vision.ds.Color.fromInt(value); } catch (e) { } return { - testName: "vision.ds.Color.color_greater_than_float", + testName: "vision.ds.Color.fromInt", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_greater_than_equal_int__ShouldWork():TestResult { + public static function vision_ds_Color__fromRGBA_Int_Int_Int_Int_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0; + var Red = 0; + var Green = 0; + var Blue = 0; + var Alpha = 0; - result = vision.ds.Color.color_greater_than_equal_int(lhs, rhs); + result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_greater_than_equal_int", + testName: "vision.ds.Color.fromRGBA", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_greater_than_equal_float__ShouldWork():TestResult { + public static function vision_ds_Color__from8Bit_Int_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0.0; + var Value = 0; - result = vision.ds.Color.color_greater_than_equal_float(lhs, rhs); + result = vision.ds.Color.from8Bit(Value); } catch (e) { } return { - testName: "vision.ds.Color.color_greater_than_equal_float", + testName: "vision.ds.Color.from8Bit", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_greater_than_equal_color__ShouldWork():TestResult { + public static function vision_ds_Color__fromFloat_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var Value = 0.0; - result = vision.ds.Color.color_greater_than_equal_color(lhs, rhs); + result = vision.ds.Color.fromFloat(Value); } catch (e) { } return { - testName: "vision.ds.Color.color_greater_than_equal_color", + testName: "vision.ds.Color.fromFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_greater_than_color__ShouldWork():TestResult { + public static function vision_ds_Color__fromRGBAFloat_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var Red = 0.0; + var Green = 0.0; + var Blue = 0.0; + var Alpha = 0.0; - result = vision.ds.Color.color_greater_than_color(lhs, rhs); + result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_greater_than_color", + testName: "vision.ds.Color.fromRGBAFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_equal_int__ShouldWork():TestResult { + public static function vision_ds_Color__fromCMYK_Float_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0; + var Cyan = 0.0; + var Magenta = 0.0; + var Yellow = 0.0; + var Black = 0.0; + var Alpha = 0.0; - result = vision.ds.Color.color_equal_int(lhs, rhs); + result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_equal_int", + testName: "vision.ds.Color.fromCMYK", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_equal_float__ShouldWork():TestResult { + public static function vision_ds_Color__fromHSB_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0.0; + var Hue = 0.0; + var Saturation = 0.0; + var Brightness = 0.0; + var Alpha = 0.0; - result = vision.ds.Color.color_equal_float(lhs, rhs); + result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_equal_float", + testName: "vision.ds.Color.fromHSB", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_equal_color__ShouldWork():TestResult { + public static function vision_ds_Color__fromHSL_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var Hue = 0.0; + var Saturation = 0.0; + var Lightness = 0.0; + var Alpha = 0.0; - result = vision.ds.Color.color_equal_color(lhs, rhs); + result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_equal_color", + testName: "vision.ds.Color.fromHSL", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_xor_int__ShouldWork():TestResult { + public static function vision_ds_Color__fromString_String_NullColor__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0; + var str = ""; - result = vision.ds.Color.color_bitwise_xor_int(lhs, rhs); + result = vision.ds.Color.fromString(str); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_xor_int", + testName: "vision.ds.Color.fromString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_xor_color__ShouldWork():TestResult { + public static function vision_ds_Color__getHSBColorWheel_Int_ArrayColor__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var Alpha = 0; - result = vision.ds.Color.color_bitwise_xor_color(lhs, rhs); + result = vision.ds.Color.getHSBColorWheel(Alpha); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_xor_color", + testName: "vision.ds.Color.getHSBColorWheel", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_unsigned_right_shift_int__ShouldWork():TestResult { + public static function vision_ds_Color__interpolate_Color_Color_Float_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0; + var Color1:Color = null; + var Color2:Color = null; + var Factor = 0.0; - result = vision.ds.Color.color_bitwise_unsigned_right_shift_int(lhs, rhs); + result = vision.ds.Color.interpolate(Color1, Color2, Factor); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_unsigned_right_shift_int", + testName: "vision.ds.Color.interpolate", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_unsigned_right_shift_color__ShouldWork():TestResult { + public static function vision_ds_Color__gradient_Color_Color_Int_FloatFloat_ArrayColor__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var Color1:Color = null; + var Color2:Color = null; + var Steps = 0; + var Ease = (_) -> null; - result = vision.ds.Color.color_bitwise_unsigned_right_shift_color(lhs, rhs); + result = vision.ds.Color.gradient(Color1, Color2, Steps, Ease); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_unsigned_right_shift_color", + testName: "vision.ds.Color.gradient", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_right_shift_int__ShouldWork():TestResult { + public static function vision_ds_Color__makeRandom_Bool_Int_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs = 0; + var alphaLock = false; + var alphaValue = 0; - result = vision.ds.Color.color_bitwise_right_shift_int(lhs, rhs); + result = vision.ds.Color.makeRandom(alphaLock, alphaValue); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_right_shift_int", + testName: "vision.ds.Color.makeRandom", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_right_shift_color__ShouldWork():TestResult { + public static function vision_ds_Color__multiply_Color_Color_Color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.color_bitwise_right_shift_color(lhs, rhs); - } catch (e) { - - } - - return { - testName: "vision.ds.Color.color_bitwise_right_shift_color", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Color__color_bitwise_or_int__ShouldWork():TestResult { - var result = null; - try { - var lhs:Color = null; - var rhs = 0; - - result = vision.ds.Color.color_bitwise_or_int(lhs, rhs); + result = vision.ds.Color.multiply(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_or_int", + testName: "vision.ds.Color.multiply", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_or_color__ShouldWork():TestResult { + public static function vision_ds_Color__add_Color_Color_Color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.color_bitwise_or_color(lhs, rhs); + result = vision.ds.Color.add(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_or_color", + testName: "vision.ds.Color.add", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_left_shift_int__ShouldWork():TestResult { + public static function vision_ds_Color__subtract_Color_Color_Color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; - var rhs = 0; + var rhs:Color = null; - result = vision.ds.Color.color_bitwise_left_shift_int(lhs, rhs); + result = vision.ds.Color.subtract(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_left_shift_int", + testName: "vision.ds.Color.subtract", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_left_shift_color__ShouldWork():TestResult { + public static function vision_ds_Color__divide_Color_Color_Color__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.color_bitwise_left_shift_color(lhs, rhs); + result = vision.ds.Color.divide(lhs, rhs); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_left_shift_color", + testName: "vision.ds.Color.divide", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_and_int__ShouldWork():TestResult { + public static function vision_ds_Color__distanceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; - var rhs = 0; + var rhs:Color = null; + var considerTransparency = false; - result = vision.ds.Color.color_bitwise_and_int(lhs, rhs); + result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_and_int", + testName: "vision.ds.Color.distanceBetween", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__color_bitwise_and_color__ShouldWork():TestResult { + public static function vision_ds_Color__differenceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { var result = null; try { var lhs:Color = null; var rhs:Color = null; + var considerTransparency = false; - result = vision.ds.Color.color_bitwise_and_color(lhs, rhs); + result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); } catch (e) { } return { - testName: "vision.ds.Color.color_bitwise_and_color", + testName: "vision.ds.Color.differenceBetween", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__add__ShouldWork():TestResult { + public static function vision_ds_Color__getAverage_ArrayColor_Bool_Color__ShouldWork():TestResult { var result = null; try { - var lhs:Color = null; - var rhs:Color = null; + var fromColors = []; + var considerTransparency = false; - result = vision.ds.Color.add(lhs, rhs); + result = vision.ds.Color.getAverage(fromColors, considerTransparency); } catch (e) { } return { - testName: "vision.ds.Color.add", + testName: "vision.ds.Color.getAverage", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__toWebString__ShouldWork():TestResult { + public static function vision_ds_Color__getComplementHarmony__Color__ShouldWork():TestResult { var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.toWebString(); + result = object.getComplementHarmony(); } catch (e) { } return { - testName: "vision.ds.Color#toWebString", + testName: "vision.ds.Color#getComplementHarmony", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__toString__ShouldWork():TestResult { + public static function vision_ds_Color__getAnalogousHarmony_Int_Harmony__ShouldWork():TestResult { var result = null; try { var value = 0; - + var Threshold = 0; + var object = new vision.ds.Color(value); - result = object.toString(); + result = object.getAnalogousHarmony(Threshold); } catch (e) { } return { - testName: "vision.ds.Color#toString", + testName: "vision.ds.Color#getAnalogousHarmony", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__toInt__ShouldWork():TestResult { + public static function vision_ds_Color__getSplitComplementHarmony_Int_Harmony__ShouldWork():TestResult { var result = null; try { var value = 0; - + var Threshold = 0; + var object = new vision.ds.Color(value); - result = object.toInt(); + result = object.getSplitComplementHarmony(Threshold); } catch (e) { } return { - testName: "vision.ds.Color#toInt", + testName: "vision.ds.Color#getSplitComplementHarmony", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__toHexString__ShouldWork():TestResult { + public static function vision_ds_Color__getTriadicHarmony__TriadicHarmony__ShouldWork():TestResult { var result = null; try { var value = 0; - var Alpha = false; - var Prefix = false; - + var object = new vision.ds.Color(value); - result = object.toHexString(Alpha, Prefix); + result = object.getTriadicHarmony(); } catch (e) { } return { - testName: "vision.ds.Color#toHexString", + testName: "vision.ds.Color#getTriadicHarmony", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__to24Bit__ShouldWork():TestResult { + public static function vision_ds_Color__to24Bit__Color__ShouldWork():TestResult { var result = null; try { var value = 0; @@ -1680,307 +825,307 @@ class ColorTests { } } - public static function vision_ds_Color__setRGBAFloat__ShouldWork():TestResult { + public static function vision_ds_Color__toHexString_Bool_Bool_String__ShouldWork():TestResult { var result = null; try { var value = 0; - var Red = 0.0; - var Green = 0.0; - var Blue = 0.0; - var Alpha = 0.0; + var Alpha = false; + var Prefix = false; var object = new vision.ds.Color(value); - result = object.setRGBAFloat(Red, Green, Blue, Alpha); + result = object.toHexString(Alpha, Prefix); } catch (e) { } return { - testName: "vision.ds.Color#setRGBAFloat", + testName: "vision.ds.Color#toHexString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__setRGBA__ShouldWork():TestResult { + public static function vision_ds_Color__toWebString__String__ShouldWork():TestResult { var result = null; try { var value = 0; - var Red = 0; - var Green = 0; - var Blue = 0; - var Alpha = 0; - + var object = new vision.ds.Color(value); - result = object.setRGBA(Red, Green, Blue, Alpha); + result = object.toWebString(); } catch (e) { } return { - testName: "vision.ds.Color#setRGBA", + testName: "vision.ds.Color#toWebString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__setHSL__ShouldWork():TestResult { + public static function vision_ds_Color__darken_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Hue = 0.0; - var Saturation = 0.0; - var Lightness = 0.0; - var Alpha = 0.0; + var Factor = 0.0; var object = new vision.ds.Color(value); - result = object.setHSL(Hue, Saturation, Lightness, Alpha); + result = object.darken(Factor); } catch (e) { } return { - testName: "vision.ds.Color#setHSL", + testName: "vision.ds.Color#darken", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__setHSB__ShouldWork():TestResult { + public static function vision_ds_Color__lighten_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Hue = 0.0; - var Saturation = 0.0; - var Brightness = 0.0; - var Alpha = 0.0; + var Factor = 0.0; var object = new vision.ds.Color(value); - result = object.setHSB(Hue, Saturation, Brightness, Alpha); + result = object.lighten(Factor); } catch (e) { } return { - testName: "vision.ds.Color#setHSB", + testName: "vision.ds.Color#lighten", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__setCMYK__ShouldWork():TestResult { + public static function vision_ds_Color__invert__Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Cyan = 0.0; - var Magenta = 0.0; - var Yellow = 0.0; - var Black = 0.0; - var Alpha = 0.0; - + var object = new vision.ds.Color(value); - result = object.setCMYK(Cyan, Magenta, Yellow, Black, Alpha); + result = object.invert(); } catch (e) { } return { - testName: "vision.ds.Color#setCMYK", + testName: "vision.ds.Color#invert", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__lighten__ShouldWork():TestResult { + public static function vision_ds_Color__setRGBA_Int_Int_Int_Int_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Factor = 0.0; + var Red = 0; + var Green = 0; + var Blue = 0; + var Alpha = 0; var object = new vision.ds.Color(value); - result = object.lighten(Factor); + result = object.setRGBA(Red, Green, Blue, Alpha); } catch (e) { } return { - testName: "vision.ds.Color#lighten", + testName: "vision.ds.Color#setRGBA", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__invert__ShouldWork():TestResult { + public static function vision_ds_Color__setRGBAFloat_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - + var Red = 0.0; + var Green = 0.0; + var Blue = 0.0; + var Alpha = 0.0; + var object = new vision.ds.Color(value); - result = object.invert(); + result = object.setRGBAFloat(Red, Green, Blue, Alpha); } catch (e) { } return { - testName: "vision.ds.Color#invert", + testName: "vision.ds.Color#setRGBAFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__grayscale__ShouldWork():TestResult { + public static function vision_ds_Color__setCMYK_Float_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var simple = false; + var Cyan = 0.0; + var Magenta = 0.0; + var Yellow = 0.0; + var Black = 0.0; + var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.grayscale(simple); + result = object.setCMYK(Cyan, Magenta, Yellow, Black, Alpha); } catch (e) { } return { - testName: "vision.ds.Color#grayscale", + testName: "vision.ds.Color#setCMYK", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__getTriadicHarmony__ShouldWork():TestResult { + public static function vision_ds_Color__setHSB_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - + var Hue = 0.0; + var Saturation = 0.0; + var Brightness = 0.0; + var Alpha = 0.0; + var object = new vision.ds.Color(value); - result = object.getTriadicHarmony(); + result = object.setHSB(Hue, Saturation, Brightness, Alpha); } catch (e) { } return { - testName: "vision.ds.Color#getTriadicHarmony", + testName: "vision.ds.Color#setHSB", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__getSplitComplementHarmony__ShouldWork():TestResult { + public static function vision_ds_Color__setHSL_Float_Float_Float_Float_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Threshold = 0; + var Hue = 0.0; + var Saturation = 0.0; + var Lightness = 0.0; + var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.getSplitComplementHarmony(Threshold); + result = object.setHSL(Hue, Saturation, Lightness, Alpha); } catch (e) { } return { - testName: "vision.ds.Color#getSplitComplementHarmony", + testName: "vision.ds.Color#setHSL", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__getComplementHarmony__ShouldWork():TestResult { + public static function vision_ds_Color__grayscale_Bool_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - + var simple = false; + var object = new vision.ds.Color(value); - result = object.getComplementHarmony(); + result = object.grayscale(simple); } catch (e) { } return { - testName: "vision.ds.Color#getComplementHarmony", + testName: "vision.ds.Color#grayscale", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__getAnalogousHarmony__ShouldWork():TestResult { + public static function vision_ds_Color__blackOrWhite_Int_Color__ShouldWork():TestResult { var result = null; try { var value = 0; - var Threshold = 0; + var threshold = 0; var object = new vision.ds.Color(value); - result = object.getAnalogousHarmony(Threshold); + result = object.blackOrWhite(threshold); } catch (e) { } return { - testName: "vision.ds.Color#getAnalogousHarmony", + testName: "vision.ds.Color#blackOrWhite", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__darken__ShouldWork():TestResult { + public static function vision_ds_Color__toString__ShouldWork():TestResult { var result = null; try { var value = 0; - var Factor = 0.0; - + var object = new vision.ds.Color(value); - result = object.darken(Factor); + object.toString(); } catch (e) { } return { - testName: "vision.ds.Color#darken", + testName: "vision.ds.Color#toString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Color__blackOrWhite__ShouldWork():TestResult { + public static function vision_ds_Color__toInt__Int__ShouldWork():TestResult { var result = null; try { var value = 0; - var threshold = 0; - + var object = new vision.ds.Color(value); - result = object.blackOrWhite(threshold); + result = object.toInt(); } catch (e) { } return { - testName: "vision.ds.Color#blackOrWhite", + testName: "vision.ds.Color#toInt", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/CramerTests.hx b/tests/generated/src/tests/CramerTests.hx index c7b21a43..fb632c72 100644 --- a/tests/generated/src/tests/CramerTests.hx +++ b/tests/generated/src/tests/CramerTests.hx @@ -6,12 +6,28 @@ import TestStatus; import vision.algorithms.Cramer; import vision.exceptions.InvalidCramerSetup; import vision.exceptions.InvalidCramerCoefficientsMatrix; -import vision.tools.MathTools; import vision.ds.Matrix2D; -import haxe.ds.Vector; -import vision.ds.Array2D; @:access(vision.algorithms.Cramer) class CramerTests { + public static function vision_algorithms_Cramer__solveVariablesFor_Matrix2D_ArrayFloat_ArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var coefficients:Matrix2D = null; + var solutions = []; + + result = vision.algorithms.Cramer.solveVariablesFor(coefficients, solutions); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Cramer.solveVariablesFor", + returned: result, + expected: null, + status: Unimplemented + } + } + } \ No newline at end of file diff --git a/tests/generated/src/tests/FormatImageExporterTests.hx b/tests/generated/src/tests/FormatImageExporterTests.hx index 9d420960..aa76aa6a 100644 --- a/tests/generated/src/tests/FormatImageExporterTests.hx +++ b/tests/generated/src/tests/FormatImageExporterTests.hx @@ -19,7 +19,7 @@ import format.jpg.Data; @:access(vision.formats.__internal.FormatImageExporter) class FormatImageExporterTests { - public static function vision_formats___internal_FormatImageExporter__png__ShouldWork():TestResult { + public static function vision_formats___internal_FormatImageExporter__png_Image_ByteArray__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); @@ -37,36 +37,36 @@ class FormatImageExporterTests { } } - public static function vision_formats___internal_FormatImageExporter__jpeg__ShouldWork():TestResult { + public static function vision_formats___internal_FormatImageExporter__bmp_Image_ByteArray__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.formats.__internal.FormatImageExporter.jpeg(image); + result = vision.formats.__internal.FormatImageExporter.bmp(image); } catch (e) { } return { - testName: "vision.formats.__internal.FormatImageExporter.jpeg", + testName: "vision.formats.__internal.FormatImageExporter.bmp", returned: result, expected: null, status: Unimplemented } } - public static function vision_formats___internal_FormatImageExporter__bmp__ShouldWork():TestResult { + public static function vision_formats___internal_FormatImageExporter__jpeg_Image_ByteArray__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.formats.__internal.FormatImageExporter.bmp(image); + result = vision.formats.__internal.FormatImageExporter.jpeg(image); } catch (e) { } return { - testName: "vision.formats.__internal.FormatImageExporter.bmp", + testName: "vision.formats.__internal.FormatImageExporter.jpeg", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/FormatImageLoaderTests.hx b/tests/generated/src/tests/FormatImageLoaderTests.hx index a994788c..00a2d583 100644 --- a/tests/generated/src/tests/FormatImageLoaderTests.hx +++ b/tests/generated/src/tests/FormatImageLoaderTests.hx @@ -15,7 +15,7 @@ import format.bmp.Tools; @:access(vision.formats.__internal.FormatImageLoader) class FormatImageLoaderTests { - public static function vision_formats___internal_FormatImageLoader__png__ShouldWork():TestResult { + public static function vision_formats___internal_FormatImageLoader__png_ByteArray_Image__ShouldWork():TestResult { var result = null; try { var bytes = vision.ds.ByteArray.from(0); @@ -33,7 +33,7 @@ class FormatImageLoaderTests { } } - public static function vision_formats___internal_FormatImageLoader__bmp__ShouldWork():TestResult { + public static function vision_formats___internal_FormatImageLoader__bmp_ByteArray_Image__ShouldWork():TestResult { var result = null; try { var bytes = vision.ds.ByteArray.from(0); diff --git a/tests/generated/src/tests/GaussJordanTests.hx b/tests/generated/src/tests/GaussJordanTests.hx index cd2acd9a..1a94801c 100644 --- a/tests/generated/src/tests/GaussJordanTests.hx +++ b/tests/generated/src/tests/GaussJordanTests.hx @@ -8,27 +8,7 @@ import vision.ds.Matrix2D; @:access(vision.algorithms.GaussJordan) class GaussJordanTests { - public static function vision_algorithms_GaussJordan__swapRows__ShouldWork():TestResult { - var result = null; - try { - var matrix = []; - var row1 = 0; - var row2 = 0; - - result = vision.algorithms.GaussJordan.swapRows(matrix, row1, row2); - } catch (e) { - - } - - return { - testName: "vision.algorithms.GaussJordan.swapRows", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_algorithms_GaussJordan__invert__ShouldWork():TestResult { + public static function vision_algorithms_GaussJordan__invert_Matrix2D_Matrix2D__ShouldWork():TestResult { var result = null; try { var matrix:Matrix2D = null; @@ -46,67 +26,5 @@ class GaussJordanTests { } } - public static function vision_algorithms_GaussJordan__extractMatrix__ShouldWork():TestResult { - var result = null; - try { - var matrix:Matrix2D = null; - var rows = 0; - var columns = []; - - result = vision.algorithms.GaussJordan.extractMatrix(matrix, rows, columns); - } catch (e) { - - } - - return { - testName: "vision.algorithms.GaussJordan.extractMatrix", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_algorithms_GaussJordan__createIdentityMatrix__ShouldWork():TestResult { - var result = null; - try { - var size = 0; - - result = vision.algorithms.GaussJordan.createIdentityMatrix(size); - } catch (e) { - - } - - return { - testName: "vision.algorithms.GaussJordan.createIdentityMatrix", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_algorithms_GaussJordan__augmentMatrix__ShouldWork():TestResult { - var result = null; - try { - var matrix = []; - var augmentation = []; - - result = vision.algorithms.GaussJordan.augmentMatrix(matrix, augmentation); - } catch (e) { - - } - - return { - testName: "vision.algorithms.GaussJordan.augmentMatrix", - returned: result, - expected: null, - status: Unimplemented - } - } - public static var tests = [ - vision_algorithms_GaussJordan__swapRows__ShouldWork, - vision_algorithms_GaussJordan__invert__ShouldWork, - vision_algorithms_GaussJordan__extractMatrix__ShouldWork, - vision_algorithms_GaussJordan__createIdentityMatrix__ShouldWork, - vision_algorithms_GaussJordan__augmentMatrix__ShouldWork]; } \ No newline at end of file diff --git a/tests/generated/src/tests/GaussTests.hx b/tests/generated/src/tests/GaussTests.hx index be353282..8b269165 100644 --- a/tests/generated/src/tests/GaussTests.hx +++ b/tests/generated/src/tests/GaussTests.hx @@ -11,27 +11,97 @@ import vision.exceptions.InvalidGaussianKernelSize; @:access(vision.algorithms.Gauss) class GaussTests { - public static function vision_algorithms_Gauss__fastBlur__ShouldWork():TestResult { + public static function vision_algorithms_Gauss__create1x1Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { var result = null; try { - var image = new vision.ds.Image(100, 100); - var size = 0; - var sigma = 0.0; + var sigma = 0.0; - result = vision.algorithms.Gauss.fastBlur(image, size, sigma); + result = vision.algorithms.Gauss.create1x1Kernel(sigma); } catch (e) { } return { - testName: "vision.algorithms.Gauss.fastBlur", + testName: "vision.algorithms.Gauss.create1x1Kernel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__create3x3Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var sigma = 0.0; + + result = vision.algorithms.Gauss.create3x3Kernel(sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create3x3Kernel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__create5x5Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var sigma = 0.0; + + result = vision.algorithms.Gauss.create5x5Kernel(sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create5x5Kernel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__create7x7Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var sigma = 0.0; + + result = vision.algorithms.Gauss.create7x7Kernel(sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create7x7Kernel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__create9x9Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var sigma = 0.0; + + result = vision.algorithms.Gauss.create9x9Kernel(sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create9x9Kernel", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Gauss__createKernelOfSize__ShouldWork():TestResult { + public static function vision_algorithms_Gauss__createKernelOfSize_Int_Int_Array2DFloat__ShouldWork():TestResult { var result = null; try { var size = 0; @@ -50,5 +120,63 @@ class GaussTests { } } + public static function vision_algorithms_Gauss__create2DKernelOfSize_Int_Float_Array2DFloat__ShouldWork():TestResult { + var result = null; + try { + var size = 0; + var sigma = 0.0; + + result = vision.algorithms.Gauss.create2DKernelOfSize(size, sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create2DKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__create1DKernelOfSize_Int_Float_ArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var size = 0; + var sigma = 0.0; + + result = vision.algorithms.Gauss.create1DKernelOfSize(size, sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.create1DKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Gauss__fastBlur_Image_Int_Float_Image__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var size = 0; + var sigma = 0.0; + + result = vision.algorithms.Gauss.fastBlur(image, size, sigma); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Gauss.fastBlur", + returned: result, + expected: null, + status: Unimplemented + } + } + } \ No newline at end of file diff --git a/tests/generated/src/tests/HistogramTests.hx b/tests/generated/src/tests/HistogramTests.hx index 9bd18225..51525438 100644 --- a/tests/generated/src/tests/HistogramTests.hx +++ b/tests/generated/src/tests/HistogramTests.hx @@ -44,7 +44,7 @@ class HistogramTests { } } - public static function vision_ds_Histogram__increment__ShouldWork():TestResult { + public static function vision_ds_Histogram__increment_Int_Histogram__ShouldWork():TestResult { var result = null; try { @@ -64,7 +64,7 @@ class HistogramTests { } } - public static function vision_ds_Histogram__decrement__ShouldWork():TestResult { + public static function vision_ds_Histogram__decrement_Int_Histogram__ShouldWork():TestResult { var result = null; try { diff --git a/tests/generated/src/tests/ImageHashingTests.hx b/tests/generated/src/tests/ImageHashingTests.hx index 0e135b70..b2b1e441 100644 --- a/tests/generated/src/tests/ImageHashingTests.hx +++ b/tests/generated/src/tests/ImageHashingTests.hx @@ -6,44 +6,42 @@ import TestStatus; import vision.algorithms.ImageHashing; import haxe.Int64; import vision.ds.Matrix2D; -import vision.tools.ImageTools; import vision.ds.ByteArray; import vision.ds.Image; -import vision.ds.ImageResizeAlgorithm; @:access(vision.algorithms.ImageHashing) class ImageHashingTests { - public static function vision_algorithms_ImageHashing__phash__ShouldWork():TestResult { + public static function vision_algorithms_ImageHashing__ahash_Image_Int_ByteArray__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var hashByteSize = 0; - result = vision.algorithms.ImageHashing.phash(image); + result = vision.algorithms.ImageHashing.ahash(image, hashByteSize); } catch (e) { } return { - testName: "vision.algorithms.ImageHashing.phash", + testName: "vision.algorithms.ImageHashing.ahash", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_ImageHashing__ahash__ShouldWork():TestResult { + public static function vision_algorithms_ImageHashing__phash_Image_ByteArray__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var hashByteSize = 0; - result = vision.algorithms.ImageHashing.ahash(image, hashByteSize); + result = vision.algorithms.ImageHashing.phash(image); } catch (e) { } return { - testName: "vision.algorithms.ImageHashing.ahash", + testName: "vision.algorithms.ImageHashing.phash", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/ImageTests.hx b/tests/generated/src/tests/ImageTests.hx new file mode 100644 index 00000000..f87957bb --- /dev/null +++ b/tests/generated/src/tests/ImageTests.hx @@ -0,0 +1,1891 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Image; +import vision.formats.ImageIO; +import vision.ds.ByteArray; +import vision.exceptions.Unimplemented; +import vision.algorithms.BilinearInterpolation; +import haxe.ds.List; +import haxe.Int64; +import vision.ds.Color; +import vision.exceptions.OutOfBounds; +import vision.tools.ImageTools; +import vision.ds.ImageView; +import vision.ds.ImageResizeAlgorithm; +import vision.ds.Rectangle; + +@:access(vision.ds.Image) +class ImageTests { + public static function vision_ds_Image__view__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + result = object.view; + } catch (e) { + + } + + return { + testName: "vision.ds.Image#view", + returned: result, + expected: null, + status: Unimplemented + } + } + + #if flixel + + public static function vision_ds_Image__toFlxSprite__flixelFlxSprite__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toFlxSprite(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toFlxSprite", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromFlxSprite_flixelFlxSprite_Image__ShouldWork():TestResult { + var result = null; + try { + var sprite:flixel.FlxSprite = null; + + result = vision.ds.Image.fromFlxSprite(sprite); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromFlxSprite", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if (flash || openfl) + + public static function vision_ds_Image__toBitmapData__flashdisplayBitmapData__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toBitmapData(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toBitmapData", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toShape__flashdisplayShape__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toShape(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toShape", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toSprite__flashdisplaySprite__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toSprite(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toSprite", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromBitmapData_flashdisplayBitmapData_Image__ShouldWork():TestResult { + var result = null; + try { + var bitmapData:flash.display.BitmapData = null; + + result = vision.ds.Image.fromBitmapData(bitmapData); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromBitmapData", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromShape_flashdisplayShape_Image__ShouldWork():TestResult { + var result = null; + try { + var shape:flash.display.Shape = null; + + result = vision.ds.Image.fromShape(shape); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromShape", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromSprite_flashdisplaySprite_Image__ShouldWork():TestResult { + var result = null; + try { + var sprite:flash.display.Sprite = null; + + result = vision.ds.Image.fromSprite(sprite); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromSprite", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if lime + + public static function vision_ds_Image__toLimeImage__limegraphicsImage__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toLimeImage(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toLimeImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + + public static function vision_ds_Image__fromLimeImage_limegraphicsImage_Image__ShouldWork():TestResult { + var result = null; + try { + var image:lime.graphics.Image = null; + + result = vision.ds.Image.fromLimeImage(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromLimeImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if kha + + public static function vision_ds_Image__fromKhaImage_khaImage_Image__ShouldWork():TestResult { + var result = null; + try { + var image:kha.Image = null; + + result = vision.ds.Image.fromKhaImage(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromKhaImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if heaps + + public static function vision_ds_Image__toHeapsPixels__hxdPixels__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toHeapsPixels(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toHeapsPixels", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromHeapsPixels_hxdPixels_Image__ShouldWork():TestResult { + var result = null; + try { + var pixels:hxd.Pixels = null; + + result = vision.ds.Image.fromHeapsPixels(pixels); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromHeapsPixels", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if js + + public static function vision_ds_Image__toJsCanvas__jshtmlCanvasElement__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toJsCanvas(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toJsCanvas", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toJsImage__jshtmlImageElement__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toJsImage(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toJsImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromJsCanvas_jshtmlCanvasElement_Image__ShouldWork():TestResult { + var result = null; + try { + var canvas:js.html.CanvasElement = null; + + result = vision.ds.Image.fromJsCanvas(canvas); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromJsCanvas", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromJsImage_jshtmlImageElement_Image__ShouldWork():TestResult { + var result = null; + try { + var image:js.html.ImageElement = null; + + result = vision.ds.Image.fromJsImage(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromJsImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + #if haxeui + + public static function vision_ds_Image__toHaxeUIImage__haxeuicomponentsImage__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toHaxeUIImage(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toHaxeUIImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toHaxeUIImageData__haxeuibackendImageData__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toHaxeUIImageData(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toHaxeUIImageData", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromHaxeUIImage_haxeuicomponentsImage_Image__ShouldWork():TestResult { + var result = null; + try { + var image:haxe.ui.components.Image = null; + + result = vision.ds.Image.fromHaxeUIImage(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromHaxeUIImage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fromHaxeUIImageData_haxeuibackendImageData_Image__ShouldWork():TestResult { + var result = null; + try { + var image:haxe.ui.backend.ImageData = null; + + result = vision.ds.Image.fromHaxeUIImageData(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.fromHaxeUIImageData", + returned: result, + expected: null, + status: Unimplemented + } + } + + #end + + public static function vision_ds_Image__from2DArray_Array_Image__ShouldWork():TestResult { + var result = null; + try { + var array = []; + + result = vision.ds.Image.from2DArray(array); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.from2DArray", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__loadFromBytes_ByteArray_Int_Int_Image__ShouldWork():TestResult { + var result = null; + try { + var bytes = vision.ds.ByteArray.from(0); + var width = 0; + var height = 0; + + result = vision.ds.Image.loadFromBytes(bytes, width, height); + } catch (e) { + + } + + return { + testName: "vision.ds.Image.loadFromBytes", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__getPixel_Int_Int_Color__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + + var object = new vision.ds.Image(width, height, color); + result = object.getPixel(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#getPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__getSafePixel_Int_Int_Color__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + + var object = new vision.ds.Image(width, height, color); + result = object.getSafePixel(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#getSafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__getFloatingPixel_Float_Float_Color__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + + var object = new vision.ds.Image(width, height, color); + result = object.getFloatingPixel(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#getFloatingPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__setPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.setPixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#setPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__setSafePixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.setSafePixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#setSafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__setFloatingPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.setFloatingPixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#setFloatingPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__paintPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.paintPixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#paintPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__paintFloatingPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.paintFloatingPixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#paintFloatingPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__paintSafePixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var color = 0; + + var object = new vision.ds.Image(width, height, color); + object.paintSafePixel(x, y, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#paintSafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__hasPixel_Float_Float_Bool__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + + var object = new vision.ds.Image(width, height, color); + result = object.hasPixel(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#hasPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__movePixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var fromX = 0; + var fromY = 0; + var toX = 0; + var toY = 0; + var oldPixelResetColor:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.movePixel(fromX, fromY, toX, toY, oldPixelResetColor); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#movePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__moveSafePixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var fromX = 0; + var fromY = 0; + var toX = 0; + var toY = 0; + var oldPixelResetColor:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.moveSafePixel(fromX, fromY, toX, toY, oldPixelResetColor); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#moveSafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__moveFloatingPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var fromX = 0.0; + var fromY = 0.0; + var toX = 0.0; + var toY = 0.0; + var oldPixelResetColor:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.moveFloatingPixel(fromX, fromY, toX, toY, oldPixelResetColor); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#moveFloatingPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__moveUnsafePixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var fromX = 0; + var fromY = 0; + var toX = 0; + var toY = 0; + var oldPixelResetColor:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.moveUnsafePixel(fromX, fromY, toX, toY, oldPixelResetColor); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#moveUnsafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__copyPixelFrom_Image_Int_Int_Color__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var image = new vision.ds.Image(100, 100); + var x = 0; + var y = 0; + + var object = new vision.ds.Image(width, height, color); + result = object.copyPixelFrom(image, x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#copyPixelFrom", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__copyPixelTo_Image_Int_Int_Color__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var image = new vision.ds.Image(100, 100); + var x = 0; + var y = 0; + + var object = new vision.ds.Image(width, height, color); + result = object.copyPixelTo(image, x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#copyPixelTo", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__copyImageFrom_Image_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var image = new vision.ds.Image(100, 100); + + var object = new vision.ds.Image(width, height, color); + result = object.copyImageFrom(image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#copyImageFrom", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__getImagePortion_Rectangle_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var rect:Rectangle = null; + + var object = new vision.ds.Image(width, height, color); + result = object.getImagePortion(rect); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#getImagePortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__setImagePortion__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var rect:Rectangle = null; + var image = new vision.ds.Image(100, 100); + + var object = new vision.ds.Image(width, height, color); + object.setImagePortion(rect, image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#setImagePortion", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawLine__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x1 = 0; + var y1 = 0; + var x2 = 0; + var y2 = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawLine(x1, y1, x2, y2, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawLine", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawRay2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var line = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawRay2D(line, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawLine2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawLine2D(line, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillRect__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var width = 0; + var height = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillRect(x, y, width, height, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillRect", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawRect__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var width = 0; + var height = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawRect(x, y, width, height, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawRect", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawQuadraticBezier__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var control = new vision.ds.IntPoint2D(0, 0); + var color:Color = null; + var accuracy = 0.0; + + var object = new vision.ds.Image(width, height, color); + object.drawQuadraticBezier(line, control, color, accuracy); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawQuadraticBezier", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawCubicBezier__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var control1 = new vision.ds.IntPoint2D(0, 0); + var control2 = new vision.ds.IntPoint2D(0, 0); + var color:Color = null; + var accuracy = 0.0; + + var object = new vision.ds.Image(width, height, color); + object.drawCubicBezier(line, control1, control2, color, accuracy); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawCubicBezier", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillCircle__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var X = 0; + var Y = 0; + var r = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillCircle(X, Y, r, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillCircle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawCircle__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var X = 0; + var Y = 0; + var r = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawCircle(X, Y, r, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawCircle", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillEllipse__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var centerX = 0; + var centerY = 0; + var radiusX = 0; + var radiusY = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillEllipse(centerX, centerY, radiusX, radiusY, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillEllipse", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__drawEllipse__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var centerX = 0; + var centerY = 0; + var radiusX = 0; + var radiusY = 0; + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.drawEllipse(centerX, centerY, radiusX, radiusY, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#drawEllipse", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillColorRecursive__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var position = new vision.ds.IntPoint2D(0, 0); + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillColorRecursive(position, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillColorRecursive", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillColor__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var position = new vision.ds.IntPoint2D(0, 0); + var color:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillColor(position, color); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillColor", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__fillUntilColor__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var position = new vision.ds.IntPoint2D(0, 0); + var color:Color = null; + var borderColor:Color = null; + + var object = new vision.ds.Image(width, height, color); + object.fillUntilColor(position, color, borderColor); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#fillUntilColor", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__clone__Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.clone(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#clone", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__mirror__Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.mirror(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#mirror", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__flip__Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.flip(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#flip", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__stamp_Int_Int_Image_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var X = 0; + var Y = 0; + var image = new vision.ds.Image(100, 100); + + var object = new vision.ds.Image(width, height, color); + result = object.stamp(X, Y, image); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#stamp", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__resize_Int_Int_ImageResizeAlgorithm_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var newWidth = 0; + var newHeight = 0; + var algorithm:ImageResizeAlgorithm = null; + + var object = new vision.ds.Image(width, height, color); + result = object.resize(newWidth, newHeight, algorithm); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#resize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__rotate_Float_Bool_Bool_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var angle = 0.0; + var degrees = false; + var expandImageBounds = false; + + var object = new vision.ds.Image(width, height, color); + result = object.rotate(angle, degrees, expandImageBounds); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#rotate", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toString_Bool_String__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var special = false; + + var object = new vision.ds.Image(width, height, color); + result = object.toString(special); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__forEachPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var callback = (_, _, _) -> null; + + var object = new vision.ds.Image(width, height, color); + object.forEachPixel(callback); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#forEachPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__forEachPixelInView__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var callback = (_, _, _) -> null; + + var object = new vision.ds.Image(width, height, color); + object.forEachPixelInView(callback); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#forEachPixelInView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__iterator__IteratorPixel__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.iterator(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#iterator", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__center__Point2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.center(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#center", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__pixelToRelative_Point2D_Point2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Image(width, height, color); + result = object.pixelToRelative(point); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#pixelToRelative", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__pixelToRelative_Float_Float_Point2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + + var object = new vision.ds.Image(width, height, color); + result = object.pixelToRelative(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#pixelToRelative", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__relativeToPixel_Point2D_Point2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.Image(width, height, color); + result = object.relativeToPixel(point); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#relativeToPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__relativeToPixel_Float_Float_Point2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0.0; + var y = 0.0; + + var object = new vision.ds.Image(width, height, color); + result = object.relativeToPixel(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#relativeToPixel", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__hasView__Bool__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.hasView(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#hasView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__setView_ImageView_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var view:ImageView = null; + + var object = new vision.ds.Image(width, height, color); + result = object.setView(view); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#setView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__getView__ImageView__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.getView(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#getView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__removeView__Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.removeView(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#removeView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__copyViewFrom_Image_Image__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var from = new vision.ds.Image(100, 100); + + var object = new vision.ds.Image(width, height, color); + result = object.copyViewFrom(from); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#copyViewFrom", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__hasPixelInView_Int_Int_ImageView_Bool__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + var x = 0; + var y = 0; + var v:ImageView = null; + + var object = new vision.ds.Image(width, height, color); + result = object.hasPixelInView(x, y, v); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#hasPixelInView", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__to2DArray__ArrayArrayColor__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.to2DArray(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#to2DArray", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Image__toArray__ArrayColor__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + var color:Color = null; + + + var object = new vision.ds.Image(width, height, color); + result = object.toArray(); + } catch (e) { + + } + + return { + testName: "vision.ds.Image#toArray", + returned: result, + expected: null, + status: Unimplemented + } + } +} \ No newline at end of file diff --git a/tests/generated/src/tests/ImageViewTests.hx b/tests/generated/src/tests/ImageViewTests.hx new file mode 100644 index 00000000..ca72d54c --- /dev/null +++ b/tests/generated/src/tests/ImageViewTests.hx @@ -0,0 +1,31 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.ImageView; +import vision.ds.ImageViewShape; + +@:access(vision.ds.ImageView) +class ImageViewTests { + public static function vision_ds_ImageView__toString__String__ShouldWork():TestResult { + var result = null; + try { + + + var object:ImageView = {x: 0, y: 0, width: 0, height: 0, shape: RECTANGLE}; + result = object.toString(); + } catch (e) { + + } + + return { + testName: "vision.ds.ImageView#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/Int16Point2DTests.hx b/tests/generated/src/tests/Int16Point2DTests.hx index cbce9ce8..ef5b72de 100644 --- a/tests/generated/src/tests/Int16Point2DTests.hx +++ b/tests/generated/src/tests/Int16Point2DTests.hx @@ -48,7 +48,7 @@ class Int16Point2DTests { } } - public static function vision_ds_Int16Point2D__toString__ShouldWork():TestResult { + public static function vision_ds_Int16Point2D__toString__String__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -69,7 +69,7 @@ class Int16Point2DTests { } } - public static function vision_ds_Int16Point2D__toPoint2D__ShouldWork():TestResult { + public static function vision_ds_Int16Point2D__toPoint2D__Point2D__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -90,7 +90,7 @@ class Int16Point2DTests { } } - public static function vision_ds_Int16Point2D__toIntPoint2D__ShouldWork():TestResult { + public static function vision_ds_Int16Point2D__toIntPoint2D__Point2D__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -111,7 +111,7 @@ class Int16Point2DTests { } } - public static function vision_ds_Int16Point2D__toInt__ShouldWork():TestResult { + public static function vision_ds_Int16Point2D__toInt__Int__ShouldWork():TestResult { var result = null; try { var X = 0; diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index cb671db1..c061d7b0 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -50,7 +50,7 @@ class IntPoint2DTests { } } - public static function vision_ds_IntPoint2D__fromPoint2D__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__fromPoint2D_Point2D_IntPoint2D__ShouldWork():TestResult { var result = null; try { var p = new vision.ds.Point2D(0, 0); @@ -68,7 +68,7 @@ class IntPoint2DTests { } } - public static function vision_ds_IntPoint2D__toString__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__toPoint2D__Point2D__ShouldWork():TestResult { var result = null; try { var x = 0; @@ -76,20 +76,20 @@ class IntPoint2DTests { var object = new vision.ds.IntPoint2D(x, y); - result = object.toString(); + result = object.toPoint2D(); } catch (e) { } return { - testName: "vision.ds.IntPoint2D#toString", + testName: "vision.ds.IntPoint2D#toPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_IntPoint2D__toPoint2D__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__toString__String__ShouldWork():TestResult { var result = null; try { var x = 0; @@ -97,42 +97,41 @@ class IntPoint2DTests { var object = new vision.ds.IntPoint2D(x, y); - result = object.toPoint2D(); + result = object.toString(); } catch (e) { } return { - testName: "vision.ds.IntPoint2D#toPoint2D", + testName: "vision.ds.IntPoint2D#toString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_IntPoint2D__radiansTo__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__copy__IntPoint2D__ShouldWork():TestResult { var result = null; try { var x = 0; var y = 0; - var point = new vision.ds.Point2D(0, 0); - + var object = new vision.ds.IntPoint2D(x, y); - result = object.radiansTo(point); + result = object.copy(); } catch (e) { } return { - testName: "vision.ds.IntPoint2D#radiansTo", + testName: "vision.ds.IntPoint2D#copy", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_IntPoint2D__distanceTo__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__distanceTo_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0; @@ -154,7 +153,7 @@ class IntPoint2DTests { } } - public static function vision_ds_IntPoint2D__degreesTo__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__degreesTo_Point2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0; @@ -176,21 +175,22 @@ class IntPoint2DTests { } } - public static function vision_ds_IntPoint2D__copy__ShouldWork():TestResult { + public static function vision_ds_IntPoint2D__radiansTo_Point2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0; var y = 0; - + var point = new vision.ds.Point2D(0, 0); + var object = new vision.ds.IntPoint2D(x, y); - result = object.copy(); + result = object.radiansTo(point); } catch (e) { } return { - testName: "vision.ds.IntPoint2D#copy", + testName: "vision.ds.IntPoint2D#radiansTo", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/KMeansTests.hx b/tests/generated/src/tests/KMeansTests.hx index b46d8260..3f2196cd 100644 --- a/tests/generated/src/tests/KMeansTests.hx +++ b/tests/generated/src/tests/KMeansTests.hx @@ -11,5 +11,65 @@ import vision.exceptions.Unimplemented; @:access(vision.algorithms.KMeans) class KMeansTests { + public static function vision_algorithms_KMeans__generateClustersUsingConvergence_ArrayT_Int_TTFloat_ArrayTT_ArrayArrayT__ShouldWork():TestResult { + var result = null; + try { + var values = []; + var clusterAmount = 0; + var distanceFunction = (_, _) -> null; + var averageFunction = (_) -> null; + + result = vision.algorithms.KMeans.generateClustersUsingConvergence(values, clusterAmount, distanceFunction, averageFunction); + } catch (e) { + + } + + return { + testName: "vision.algorithms.KMeans.generateClustersUsingConvergence", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_KMeans__getImageColorClusters_Image_Int_ArrayColorCluster__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var clusterAmount = 0; + + result = vision.algorithms.KMeans.getImageColorClusters(image, clusterAmount); + } catch (e) { + + } + + return { + testName: "vision.algorithms.KMeans.getImageColorClusters", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_KMeans__pickElementsAtRandom_ArrayT_Int_Bool_ArrayT__ShouldWork():TestResult { + var result = null; + try { + var values = []; + var amount = 0; + var distinct = false; + + result = vision.algorithms.KMeans.pickElementsAtRandom(values, amount, distinct); + } catch (e) { + + } + + return { + testName: "vision.algorithms.KMeans.pickElementsAtRandom", + returned: result, + expected: null, + status: Unimplemented + } + } + } \ No newline at end of file diff --git a/tests/generated/src/tests/LaplaceTests.hx b/tests/generated/src/tests/LaplaceTests.hx index dfc2848d..7f35fe9f 100644 --- a/tests/generated/src/tests/LaplaceTests.hx +++ b/tests/generated/src/tests/LaplaceTests.hx @@ -11,41 +11,41 @@ import vision.ds.Image; @:access(vision.algorithms.Laplace) class LaplaceTests { - public static function vision_algorithms_Laplace__laplacianOfGaussian__ShouldWork():TestResult { + public static function vision_algorithms_Laplace__convolveWithLaplacianOperator_Image_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var kernelSize:GaussianKernelSize = null; - var sigma = 0.0; - var threshold = 0.0; var positive = false; - result = vision.algorithms.Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, positive); + result = vision.algorithms.Laplace.convolveWithLaplacianOperator(image, positive); } catch (e) { } return { - testName: "vision.algorithms.Laplace.laplacianOfGaussian", + testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Laplace__convolveWithLaplacianOperator__ShouldWork():TestResult { + public static function vision_algorithms_Laplace__laplacianOfGaussian_Image_GaussianKernelSize_Float_Float_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var kernelSize:GaussianKernelSize = null; + var sigma = 0.0; + var threshold = 0.0; var positive = false; - result = vision.algorithms.Laplace.convolveWithLaplacianOperator(image, positive); + result = vision.algorithms.Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, positive); } catch (e) { } return { - testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", + testName: "vision.algorithms.Laplace.laplacianOfGaussian", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/Line2DTests.hx b/tests/generated/src/tests/Line2DTests.hx index a6dce658..ed51f384 100644 --- a/tests/generated/src/tests/Line2DTests.hx +++ b/tests/generated/src/tests/Line2DTests.hx @@ -48,7 +48,7 @@ class Line2DTests { } } - public static function vision_ds_Line2D__fromRay2D__ShouldWork():TestResult { + public static function vision_ds_Line2D__fromRay2D_Ray2D_Line2D__ShouldWork():TestResult { var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); @@ -66,86 +66,86 @@ class Line2DTests { } } - public static function vision_ds_Line2D__toString__ShouldWork():TestResult { + public static function vision_ds_Line2D__intersect_Line2D_Point2D__ShouldWork():TestResult { var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); - + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var object = new vision.ds.Line2D(start, end); - result = object.toString(); + result = object.intersect(line); } catch (e) { } return { - testName: "vision.ds.Line2D#toString", + testName: "vision.ds.Line2D#intersect", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Line2D__toRay2D__ShouldWork():TestResult { + public static function vision_ds_Line2D__distanceTo_Line2D_Float__ShouldWork():TestResult { var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); - + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var object = new vision.ds.Line2D(start, end); - result = object.toRay2D(); + result = object.distanceTo(line); } catch (e) { } return { - testName: "vision.ds.Line2D#toRay2D", + testName: "vision.ds.Line2D#distanceTo", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Line2D__intersect__ShouldWork():TestResult { + public static function vision_ds_Line2D__toString__String__ShouldWork():TestResult { var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - + var object = new vision.ds.Line2D(start, end); - result = object.intersect(line); + result = object.toString(); } catch (e) { } return { - testName: "vision.ds.Line2D#intersect", + testName: "vision.ds.Line2D#toString", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Line2D__distanceTo__ShouldWork():TestResult { + public static function vision_ds_Line2D__toRay2D__Ray2D__ShouldWork():TestResult { var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - + var object = new vision.ds.Line2D(start, end); - result = object.distanceTo(line); + result = object.toRay2D(); } catch (e) { } return { - testName: "vision.ds.Line2D#distanceTo", + testName: "vision.ds.Line2D#toRay2D", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index edcdc3a8..af17bfd5 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -4,14 +4,9 @@ import TestResult; import TestStatus; import vision.tools.MathTools; -import haxe.ds.Either; import vision.ds.Point3D; -import vision.ds.Matrix2D; import vision.ds.IntPoint2D; -import haxe.ds.Vector; -import vision.algorithms.Radix; import haxe.Int64; -import haxe.ds.ArraySort; import vision.ds.Rectangle; import vision.ds.Ray2D; import vision.ds.Line2D; @@ -131,374 +126,144 @@ class MathToolsTests { } } - public static function vision_tools_MathTools__wrapInt__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromRayToPoint2D_Ray2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var value = 0; - var min = 0; - var max = 0; - - result = vision.tools.MathTools.wrapInt(value, min, max); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.wrapInt", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__wrapFloat__ShouldWork():TestResult { - var result = null; - try { - var value = 0.0; - var min = 0.0; - var max = 0.0; - - result = vision.tools.MathTools.wrapFloat(value, min, max); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.wrapFloat", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__truncate__ShouldWork():TestResult { - var result = null; - try { - var num = 0.0; - var numbersAfterDecimal = 0; - - result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.truncate", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__toFloat__ShouldWork():TestResult { - var result = null; - try { - var value:Int64 = null; - - result = vision.tools.MathTools.toFloat(value); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.toFloat", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__tand__ShouldWork():TestResult { - var result = null; - try { - var degrees = 0.0; - - result = vision.tools.MathTools.tand(degrees); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.tand", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__tan__ShouldWork():TestResult { - var result = null; - try { - var radians = 0.0; - - result = vision.tools.MathTools.tan(radians); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.tan", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__sqrt__ShouldWork():TestResult { - var result = null; - try { - var v = 0.0; - - result = vision.tools.MathTools.sqrt(v); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.sqrt", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__slopeToRadians__ShouldWork():TestResult { - var result = null; - try { - var slope = 0.0; - - result = vision.tools.MathTools.slopeToRadians(slope); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.slopeToRadians", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__slopeToDegrees__ShouldWork():TestResult { - var result = null; - try { - var slope = 0.0; - - result = vision.tools.MathTools.slopeToDegrees(slope); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.slopeToDegrees", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__slopeFromPointToPoint2D__ShouldWork():TestResult { - var result = null; - try { - var point1 = new vision.ds.IntPoint2D(0, 0); - var point2 = new vision.ds.Point2D(0, 0); - - result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__sind__ShouldWork():TestResult { - var result = null; - try { - var degrees = 0.0; - - result = vision.tools.MathTools.sind(degrees); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.sind", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__sin__ShouldWork():TestResult { - var result = null; - try { - var radians = 0.0; - - result = vision.tools.MathTools.sin(radians); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.sin", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__secd__ShouldWork():TestResult { - var result = null; - try { - var degrees = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var point = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.secd(degrees); + result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); } catch (e) { } return { - testName: "vision.tools.MathTools.secd", + testName: "vision.tools.MathTools.distanceFromRayToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__sec__ShouldWork():TestResult { + public static function vision_tools_MathTools__intersectionBetweenRay2Ds_Ray2D_Ray2D_Point2D__ShouldWork():TestResult { var result = null; try { - var radians = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.sec(radians); + result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); } catch (e) { } return { - testName: "vision.tools.MathTools.sec", + testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__round__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenRays2D_Ray2D_Ray2D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.round(v); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.round", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_tools_MathTools__random__ShouldWork():TestResult { - var result = null; - try { - - result = vision.tools.MathTools.random(); + result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); } catch (e) { } return { - testName: "vision.tools.MathTools.random", + testName: "vision.tools.MathTools.distanceBetweenRays2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__radiansToSlope__ShouldWork():TestResult { + public static function vision_tools_MathTools__findPointAtDistanceUsingX_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { var result = null; try { - var radians = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var startXPos = 0.0; + var distance = 0.0; + var goPositive = false; - result = vision.tools.MathTools.radiansToSlope(radians); + result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); } catch (e) { } return { - testName: "vision.tools.MathTools.radiansToSlope", + testName: "vision.tools.MathTools.findPointAtDistanceUsingX", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__radiansToDegrees__ShouldWork():TestResult { + public static function vision_tools_MathTools__findPointAtDistanceUsingY_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { var result = null; try { - var radians = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var startYPos = 0.0; + var distance = 0.0; + var goPositive = false; - result = vision.tools.MathTools.radiansToDegrees(radians); + result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); } catch (e) { } return { - testName: "vision.tools.MathTools.radiansToDegrees", + testName: "vision.tools.MathTools.findPointAtDistanceUsingY", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__radiansFromPointToPoint2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var point1 = new vision.ds.IntPoint2D(0, 0); - var point2 = new vision.ds.Point2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var point = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); + result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); } catch (e) { } return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__radiansFromPointToLine2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenLines2D_Line2D_Line2D_Float__ShouldWork():TestResult { var result = null; try { - var point = new vision.ds.IntPoint2D(0, 0); - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); + result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); } catch (e) { } return { - testName: "vision.tools.MathTools.radiansFromPointToLine2D", + testName: "vision.tools.MathTools.distanceBetweenLines2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__radiansFromLineToPoint2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); @@ -517,816 +282,841 @@ class MathToolsTests { } } - public static function vision_tools_MathTools__pow__ShouldWork():TestResult { + public static function vision_tools_MathTools__intersectionBetweenLine2Ds_Line2D_Line2D_Point2D__ShouldWork():TestResult { var result = null; try { - var v = 0.0; - var exp = 0.0; + var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.pow(v, exp); + result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); } catch (e) { } return { - testName: "vision.tools.MathTools.pow", + testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__parseInt__ShouldWork():TestResult { + public static function vision_tools_MathTools__mirrorInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { var result = null; try { - var s = ""; + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; - result = vision.tools.MathTools.parseInt(s); + result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); } catch (e) { } return { - testName: "vision.tools.MathTools.parseInt", + testName: "vision.tools.MathTools.mirrorInsideRectangle", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__parseFloat__ShouldWork():TestResult { + public static function vision_tools_MathTools__flipInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { var result = null; try { - var s = ""; + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; - result = vision.tools.MathTools.parseFloat(s); + result = vision.tools.MathTools.flipInsideRectangle(line, rect); } catch (e) { } return { - testName: "vision.tools.MathTools.parseFloat", + testName: "vision.tools.MathTools.flipInsideRectangle", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__parseBool__ShouldWork():TestResult { + public static function vision_tools_MathTools__invertInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { var result = null; try { - var s = ""; + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var rect:Rectangle = null; - result = vision.tools.MathTools.parseBool(s); + result = vision.tools.MathTools.invertInsideRectangle(line, rect); } catch (e) { } return { - testName: "vision.tools.MathTools.parseBool", + testName: "vision.tools.MathTools.invertInsideRectangle", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__mirrorInsideRectangle__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromPointToRay2D_Point2D_Ray2D_Float__ShouldWork():TestResult { var result = null; try { - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var point = new vision.ds.Point2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); + result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); } catch (e) { } return { - testName: "vision.tools.MathTools.mirrorInsideRectangle", + testName: "vision.tools.MathTools.distanceFromPointToRay2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__log__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromPointToLine2D_Point2D_Line2D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var point = new vision.ds.Point2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.log(v); + result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); } catch (e) { } return { - testName: "vision.tools.MathTools.log", + testName: "vision.tools.MathTools.distanceFromPointToLine2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__isNaN__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToLine2D_Point2D_Line2D_Float__ShouldWork():TestResult { var result = null; try { - var f = 0.0; + var point = new vision.ds.Point2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.isNaN(f); + result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); } catch (e) { } return { - testName: "vision.tools.MathTools.isNaN", + testName: "vision.tools.MathTools.radiansFromPointToLine2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__isInt__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.isInt(v); + result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.isInt", + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__isFinite__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var f = 0.0; + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.isFinite(f); + result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.isFinite", + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__isBetweenRanges__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var value = 0.0; - var ranges:{start:Float, end:Float} = null; + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.isBetweenRanges(value, ranges); + result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.isBetweenRanges", + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__isBetweenRange__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenPoints_Point2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var value = 0.0; - var min = 0.0; - var max = 0.0; + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.isBetweenRange(value, min, max); + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.isBetweenRange", + testName: "vision.tools.MathTools.distanceBetweenPoints", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__invertInsideRectangle__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.invertInsideRectangle(line, rect); + result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.invertInsideRectangle", + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__intersectionBetweenRay2Ds__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); + result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__intersectionBetweenLine2Ds__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); + result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_SQRT3__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenPoints_Point2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_SQRT3(); + var point1 = new vision.ds.Point2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); + + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.get_SQRT3", + testName: "vision.tools.MathTools.distanceBetweenPoints", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_SQRT2__ShouldWork():TestResult { + public static function vision_tools_MathTools__getClosestPointOnRay2D_Point2D_Ray2D_Point2D__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_SQRT2(); + var point = new vision.ds.Point2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); } catch (e) { } return { - testName: "vision.tools.MathTools.get_SQRT2", + testName: "vision.tools.MathTools.getClosestPointOnRay2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_POSITIVE_INFINITY__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromPointToRay2D_IntPoint2D_Ray2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_POSITIVE_INFINITY(); + var point = new vision.ds.IntPoint2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + + result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); } catch (e) { } return { - testName: "vision.tools.MathTools.get_POSITIVE_INFINITY", + testName: "vision.tools.MathTools.distanceFromPointToRay2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_PI_OVER_2__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceFromPointToLine2D_IntPoint2D_Line2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_PI_OVER_2(); + var point = new vision.ds.IntPoint2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); } catch (e) { } return { - testName: "vision.tools.MathTools.get_PI_OVER_2", + testName: "vision.tools.MathTools.distanceFromPointToLine2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_PI__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToLine2D_IntPoint2D_Line2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_PI(); + var point = new vision.ds.IntPoint2D(0, 0); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + + result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); } catch (e) { } return { - testName: "vision.tools.MathTools.get_PI", + testName: "vision.tools.MathTools.radiansFromPointToLine2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_NaN__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_NaN(); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); + + result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.get_NaN", + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__get_NEGATIVE_INFINITY__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - - result = vision.tools.MathTools.get_NEGATIVE_INFINITY(); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); + + result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.get_NEGATIVE_INFINITY", + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__getClosestPointOnRay2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - var point = new vision.ds.IntPoint2D(0, 0); - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); + result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.getClosestPointOnRay2D", + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__gamma__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenPoints_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { var result = null; try { - var x = 0.0; + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.gamma(x); + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.gamma", + testName: "vision.tools.MathTools.distanceBetweenPoints", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__fround__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.fround(v); + result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.fround", + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__floor__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.floor(v); + result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.floor", + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__flipInsideRectangle__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.flipInsideRectangle(line, rect); + result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.flipInsideRectangle", + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__findPointAtDistanceUsingY__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenPoints_IntPoint2D_Point2D_Float__ShouldWork():TestResult { var result = null; try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var startYPos = 0.0; - var distance = 0.0; - var goPositive = false; + var point1 = new vision.ds.IntPoint2D(0, 0); + var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingY", + testName: "vision.tools.MathTools.distanceBetweenPoints", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__findPointAtDistanceUsingX__ShouldWork():TestResult { + public static function vision_tools_MathTools__getClosestPointOnRay2D_IntPoint2D_Ray2D_Point2D__ShouldWork():TestResult { var result = null; try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var startXPos = 0.0; - var distance = 0.0; - var goPositive = false; + var point = new vision.ds.IntPoint2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); + result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); } catch (e) { } return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingX", + testName: "vision.tools.MathTools.getClosestPointOnRay2D", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__ffloor__ShouldWork():TestResult { + public static function vision_tools_MathTools__distanceBetweenPoints_Point3D_Point3D_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var point1:Point3D = null; + var point2:Point3D = null; - result = vision.tools.MathTools.ffloor(v); + result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); } catch (e) { } return { - testName: "vision.tools.MathTools.ffloor", + testName: "vision.tools.MathTools.distanceBetweenPoints", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__fceil__ShouldWork():TestResult { + public static function vision_tools_MathTools__clamp_Int_Int_Int_Int__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var value = 0; + var mi = 0; + var ma = 0; - result = vision.tools.MathTools.fceil(v); + result = vision.tools.MathTools.clamp(value, mi, ma); } catch (e) { } return { - testName: "vision.tools.MathTools.fceil", + testName: "vision.tools.MathTools.clamp", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__factorial__ShouldWork():TestResult { + public static function vision_tools_MathTools__isBetweenRanges_Float_startFloatendFloat_Bool__ShouldWork():TestResult { var result = null; try { var value = 0.0; + var ranges:{start:Float, end:Float} = null; - result = vision.tools.MathTools.factorial(value); + result = vision.tools.MathTools.isBetweenRanges(value, ranges); } catch (e) { } return { - testName: "vision.tools.MathTools.factorial", + testName: "vision.tools.MathTools.isBetweenRanges", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__exp__ShouldWork():TestResult { + public static function vision_tools_MathTools__isBetweenRange_Float_Float_Float_Bool__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var value = 0.0; + var min = 0.0; + var max = 0.0; - result = vision.tools.MathTools.exp(v); + result = vision.tools.MathTools.isBetweenRange(value, min, max); } catch (e) { } return { - testName: "vision.tools.MathTools.exp", + testName: "vision.tools.MathTools.isBetweenRange", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceFromRayToPoint2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__wrapInt_Int_Int_Int_Int__ShouldWork():TestResult { var result = null; try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var point = new vision.ds.Point2D(0, 0); + var value = 0; + var min = 0; + var max = 0; - result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); + result = vision.tools.MathTools.wrapInt(value, min, max); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceFromRayToPoint2D", + testName: "vision.tools.MathTools.wrapInt", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceFromPointToRay2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__wrapFloat_Float_Float_Float_Float__ShouldWork():TestResult { var result = null; try { - var point = new vision.ds.IntPoint2D(0, 0); - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var value = 0.0; + var min = 0.0; + var max = 0.0; - result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); + result = vision.tools.MathTools.wrapFloat(value, min, max); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceFromPointToRay2D", + testName: "vision.tools.MathTools.wrapFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceFromPointToLine2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__boundInt_Int_Int_Int_Int__ShouldWork():TestResult { var result = null; try { - var point = new vision.ds.IntPoint2D(0, 0); - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var value = 0; + var min = 0; + var max = 0; - result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); + result = vision.tools.MathTools.boundInt(value, min, max); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceFromPointToLine2D", + testName: "vision.tools.MathTools.boundInt", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceFromLineToPoint2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__boundFloat_Float_Float_Float_Float__ShouldWork():TestResult { var result = null; try { - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var point = new vision.ds.Point2D(0, 0); + var value = 0.0; + var min = 0.0; + var max = 0.0; - result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); + result = vision.tools.MathTools.boundFloat(value, min, max); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceFromLineToPoint2D", + testName: "vision.tools.MathTools.boundFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceBetweenRays2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__gamma_Float_Float__ShouldWork():TestResult { var result = null; try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var x = 0.0; - result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); + result = vision.tools.MathTools.gamma(x); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceBetweenRays2D", + testName: "vision.tools.MathTools.gamma", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceBetweenPoints__ShouldWork():TestResult { + public static function vision_tools_MathTools__factorial_Float_Float__ShouldWork():TestResult { var result = null; try { - var point1:Point3D = null; - var point2:Point3D = null; + var value = 0.0; - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); + result = vision.tools.MathTools.factorial(value); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceBetweenPoints", + testName: "vision.tools.MathTools.factorial", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__distanceBetweenLines2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeToDegrees_Float_Float__ShouldWork():TestResult { var result = null; try { - var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var slope = 0.0; - result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); + result = vision.tools.MathTools.slopeToDegrees(slope); } catch (e) { } return { - testName: "vision.tools.MathTools.distanceBetweenLines2D", + testName: "vision.tools.MathTools.slopeToDegrees", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__degreesToSlope__ShouldWork():TestResult { + public static function vision_tools_MathTools__slopeToRadians_Float_Float__ShouldWork():TestResult { var result = null; try { - var degrees = 0.0; + var slope = 0.0; - result = vision.tools.MathTools.degreesToSlope(degrees); + result = vision.tools.MathTools.slopeToRadians(slope); } catch (e) { } return { - testName: "vision.tools.MathTools.degreesToSlope", + testName: "vision.tools.MathTools.slopeToRadians", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__degreesToRadians__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesToSlope_Float_Float__ShouldWork():TestResult { var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.degreesToRadians(degrees); + result = vision.tools.MathTools.degreesToSlope(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.degreesToRadians", + testName: "vision.tools.MathTools.degreesToSlope", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__degreesFromPointToPoint2D__ShouldWork():TestResult { + public static function vision_tools_MathTools__degreesToRadians_Float_Float__ShouldWork():TestResult { var result = null; try { - var point1 = new vision.ds.IntPoint2D(0, 0); - var point2 = new vision.ds.Point2D(0, 0); + var degrees = 0.0; - result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); + result = vision.tools.MathTools.degreesToRadians(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + testName: "vision.tools.MathTools.degreesToRadians", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cropDecimal__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansToDegrees_Float_Float__ShouldWork():TestResult { var result = null; try { - var number = 0.0; + var radians = 0.0; - result = vision.tools.MathTools.cropDecimal(number); + result = vision.tools.MathTools.radiansToDegrees(radians); } catch (e) { } return { - testName: "vision.tools.MathTools.cropDecimal", + testName: "vision.tools.MathTools.radiansToDegrees", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cotand__ShouldWork():TestResult { + public static function vision_tools_MathTools__radiansToSlope_Float_Float__ShouldWork():TestResult { var result = null; try { - var degrees = 0.0; + var radians = 0.0; - result = vision.tools.MathTools.cotand(degrees); + result = vision.tools.MathTools.radiansToSlope(radians); } catch (e) { } return { - testName: "vision.tools.MathTools.cotand", + testName: "vision.tools.MathTools.radiansToSlope", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cotan__ShouldWork():TestResult { + public static function vision_tools_MathTools__cotan_Float_Float__ShouldWork():TestResult { var result = null; try { var radians = 0.0; @@ -1344,241 +1134,235 @@ class MathToolsTests { } } - public static function vision_tools_MathTools__cosecd__ShouldWork():TestResult { + public static function vision_tools_MathTools__cosec_Float_Float__ShouldWork():TestResult { var result = null; try { - var degrees = 0.0; + var radians = 0.0; - result = vision.tools.MathTools.cosecd(degrees); + result = vision.tools.MathTools.cosec(radians); } catch (e) { } return { - testName: "vision.tools.MathTools.cosecd", + testName: "vision.tools.MathTools.cosec", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cosec__ShouldWork():TestResult { + public static function vision_tools_MathTools__sec_Float_Float__ShouldWork():TestResult { var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.cosec(radians); + result = vision.tools.MathTools.sec(radians); } catch (e) { } return { - testName: "vision.tools.MathTools.cosec", + testName: "vision.tools.MathTools.sec", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cosd__ShouldWork():TestResult { + public static function vision_tools_MathTools__sind_Float_Float__ShouldWork():TestResult { var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.cosd(degrees); + result = vision.tools.MathTools.sind(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.cosd", + testName: "vision.tools.MathTools.sind", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__cos__ShouldWork():TestResult { + public static function vision_tools_MathTools__cosd_Float_Float__ShouldWork():TestResult { var result = null; try { - var radians = 0.0; + var degrees = 0.0; - result = vision.tools.MathTools.cos(radians); + result = vision.tools.MathTools.cosd(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.cos", + testName: "vision.tools.MathTools.cosd", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__clamp__ShouldWork():TestResult { + public static function vision_tools_MathTools__tand_Float_Float__ShouldWork():TestResult { var result = null; try { - var value = 0; - var mi = 0; - var ma = 0; + var degrees = 0.0; - result = vision.tools.MathTools.clamp(value, mi, ma); + result = vision.tools.MathTools.tand(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.clamp", + testName: "vision.tools.MathTools.tand", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__ceil__ShouldWork():TestResult { + public static function vision_tools_MathTools__cotand_Float_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var degrees = 0.0; - result = vision.tools.MathTools.ceil(v); + result = vision.tools.MathTools.cotand(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.ceil", + testName: "vision.tools.MathTools.cotand", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__boundInt__ShouldWork():TestResult { + public static function vision_tools_MathTools__cosecd_Float_Float__ShouldWork():TestResult { var result = null; try { - var value = 0; - var min = 0; - var max = 0; + var degrees = 0.0; - result = vision.tools.MathTools.boundInt(value, min, max); + result = vision.tools.MathTools.cosecd(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.boundInt", + testName: "vision.tools.MathTools.cosecd", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__boundFloat__ShouldWork():TestResult { + public static function vision_tools_MathTools__secd_Float_Float__ShouldWork():TestResult { var result = null; try { - var value = 0.0; - var min = 0.0; - var max = 0.0; + var degrees = 0.0; - result = vision.tools.MathTools.boundFloat(value, min, max); + result = vision.tools.MathTools.secd(degrees); } catch (e) { } return { - testName: "vision.tools.MathTools.boundFloat", + testName: "vision.tools.MathTools.secd", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__atan2__ShouldWork():TestResult { + public static function vision_tools_MathTools__truncate_Float_Int_Float__ShouldWork():TestResult { var result = null; try { - var y = 0.0; - var x = 0.0; + var num = 0.0; + var numbersAfterDecimal = 0; - result = vision.tools.MathTools.atan2(y, x); + result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); } catch (e) { } return { - testName: "vision.tools.MathTools.atan2", + testName: "vision.tools.MathTools.truncate", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__atan__ShouldWork():TestResult { + public static function vision_tools_MathTools__cropDecimal_Float_Int__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var number = 0.0; - result = vision.tools.MathTools.atan(v); + result = vision.tools.MathTools.cropDecimal(number); } catch (e) { } return { - testName: "vision.tools.MathTools.atan", + testName: "vision.tools.MathTools.cropDecimal", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__asin__ShouldWork():TestResult { + public static function vision_tools_MathTools__isInt_Float_Bool__ShouldWork():TestResult { var result = null; try { var v = 0.0; - result = vision.tools.MathTools.asin(v); + result = vision.tools.MathTools.isInt(v); } catch (e) { } return { - testName: "vision.tools.MathTools.asin", + testName: "vision.tools.MathTools.isInt", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__acos__ShouldWork():TestResult { + public static function vision_tools_MathTools__toFloat_Int64_Float__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var value:Int64 = null; - result = vision.tools.MathTools.acos(v); + result = vision.tools.MathTools.toFloat(value); } catch (e) { } return { - testName: "vision.tools.MathTools.acos", + testName: "vision.tools.MathTools.toFloat", returned: result, expected: null, status: Unimplemented } } - public static function vision_tools_MathTools__abs__ShouldWork():TestResult { + public static function vision_tools_MathTools__parseBool_String_Bool__ShouldWork():TestResult { var result = null; try { - var v = 0.0; + var s = ""; - result = vision.tools.MathTools.abs(v); + result = vision.tools.MathTools.parseBool(s); } catch (e) { } return { - testName: "vision.tools.MathTools.abs", + testName: "vision.tools.MathTools.parseBool", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/Matrix2DTests.hx b/tests/generated/src/tests/Matrix2DTests.hx new file mode 100644 index 00000000..bc84dcbc --- /dev/null +++ b/tests/generated/src/tests/Matrix2DTests.hx @@ -0,0 +1,807 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.Matrix2D; +import vision.algorithms.PerspectiveWarp; +import vision.ds.specifics.PointTransformationPair; +import vision.exceptions.MatrixOperationError; +import vision.algorithms.GaussJordan; +import vision.ds.Array2D; +import vision.tools.MathTools.*; + +@:access(vision.ds.Matrix2D) +class Matrix2DTests { + public static function vision_ds_Matrix2D__underlying__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.underlying; + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#underlying", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__rows__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.rows; + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#rows", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__columns__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.columns; + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#columns", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__IDENTITY__TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + + result = vision.ds.Matrix2D.IDENTITY(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.IDENTITY", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__ROTATION_Float_Bool_Point2D_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var angle = 0.0; + var degrees = false; + var origin = new vision.ds.Point2D(0, 0); + + result = vision.ds.Matrix2D.ROTATION(angle, degrees, origin); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.ROTATION", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__TRANSLATION_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var x = 0.0; + var y = 0.0; + + result = vision.ds.Matrix2D.TRANSLATION(x, y); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.TRANSLATION", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__SCALE_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var scaleX = 0.0; + var scaleY = 0.0; + + result = vision.ds.Matrix2D.SCALE(scaleX, scaleY); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.SCALE", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__SHEAR_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var shearX = 0.0; + var shearY = 0.0; + + result = vision.ds.Matrix2D.SHEAR(shearX, shearY); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.SHEAR", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__REFLECTION_Float_Bool_Point2D_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var angle = 0.0; + var degrees = false; + var origin = new vision.ds.Point2D(0, 0); + + result = vision.ds.Matrix2D.REFLECTION(angle, degrees, origin); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.REFLECTION", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__PERSPECTIVE_ArrayPointTransformationPair_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var pointPairs = []; + + result = vision.ds.Matrix2D.PERSPECTIVE(pointPairs); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.PERSPECTIVE", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__DEPTH_Float_Point2D_TransformationMatrix2D__ShouldWork():TestResult { + var result = null; + try { + var z = 0.0; + var towards = new vision.ds.Point2D(0, 0); + + result = vision.ds.Matrix2D.DEPTH(z, towards); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.DEPTH", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__createFilled_ArrayFloat_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var rows = []; + + result = vision.ds.Matrix2D.createFilled(rows); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.createFilled", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__createTransformation_ArrayFloat_ArrayFloat_ArrayFloat_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var xRow = []; + var yRow = []; + var homogeneousRow = []; + + result = vision.ds.Matrix2D.createTransformation(xRow, yRow, homogeneousRow); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.createTransformation", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__multiplyMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var a:Matrix2D = null; + var b:Matrix2D = null; + + result = vision.ds.Matrix2D.multiplyMatrices(a, b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.multiplyMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__addMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var a:Matrix2D = null; + var b:Matrix2D = null; + + result = vision.ds.Matrix2D.addMatrices(a, b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.addMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__subtractMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var a:Matrix2D = null; + var b:Matrix2D = null; + + result = vision.ds.Matrix2D.subtractMatrices(a, b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.subtractMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__divideMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var a:Matrix2D = null; + var b:Matrix2D = null; + + result = vision.ds.Matrix2D.divideMatrices(a, b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D.divideMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__invert__Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + + var object = new vision.ds.Matrix2D(width, height); + result = object.invert(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#invert", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getDeterminant__Float__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + + var object = new vision.ds.Matrix2D(width, height); + result = object.getDeterminant(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getDeterminant", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getTrace__Float__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + + var object = new vision.ds.Matrix2D(width, height); + result = object.getTrace(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getTrace", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getAverage__Float__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + + var object = new vision.ds.Matrix2D(width, height); + result = object.getAverage(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getAverage", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__multiplyWithScalar_Float_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var scalar = 0.0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.multiplyWithScalar(scalar); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#multiplyWithScalar", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__clone__Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + + var object = new vision.ds.Matrix2D(width, height); + result = object.clone(); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#clone", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__map_FloatFloat_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var mappingFunction = (_) -> null; + + var object = new vision.ds.Matrix2D(width, height); + result = object.map(mappingFunction); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#map", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getSubMatrix_Int_Int_Int_Int_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var fromX = 0; + var fromY = 0; + var toX = 0; + var toY = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.getSubMatrix(fromX, fromY, toX, toY); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getSubMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getColumn_Int_ArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var x = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.getColumn(x); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getColumn", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__getRow_Int_ArrayFloat__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var y = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.getRow(y); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#getRow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__setColumn__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var x = 0; + var arr = []; + + var object = new vision.ds.Matrix2D(width, height); + object.setColumn(x, arr); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#setColumn", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__setRow__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var y = 0; + var arr = []; + + var object = new vision.ds.Matrix2D(width, height); + object.setRow(y, arr); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#setRow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__insertColumn_Int_ArrayFloat_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var x = 0; + var arr = []; + + var object = new vision.ds.Matrix2D(width, height); + result = object.insertColumn(x, arr); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#insertColumn", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__insertRow_Int_ArrayFloat_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var y = 0; + var arr = []; + + var object = new vision.ds.Matrix2D(width, height); + result = object.insertRow(y, arr); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#insertRow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__removeColumn_Int_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var x = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.removeColumn(x); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#removeColumn", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__removeRow_Int_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var y = 0; + + var object = new vision.ds.Matrix2D(width, height); + result = object.removeRow(y); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#removeRow", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__toString_Int_Bool_String__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var precision = 0; + var pretty = false; + + var object = new vision.ds.Matrix2D(width, height); + result = object.toString(precision, pretty); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__multiply_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var b:Matrix2D = null; + + var object = new vision.ds.Matrix2D(width, height); + result = object.multiply(b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#multiply", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__add_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var b:Matrix2D = null; + + var object = new vision.ds.Matrix2D(width, height); + result = object.add(b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#add", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__subtract_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var b:Matrix2D = null; + + var object = new vision.ds.Matrix2D(width, height); + result = object.subtract(b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#subtract", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Matrix2D__divide_Matrix2D_Matrix2D__ShouldWork():TestResult { + var result = null; + try { + var width = 0; + var height = 0; + + var b:Matrix2D = null; + + var object = new vision.ds.Matrix2D(width, height); + result = object.divide(b); + } catch (e) { + + } + + return { + testName: "vision.ds.Matrix2D#divide", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/PerspectiveWarpTests.hx b/tests/generated/src/tests/PerspectiveWarpTests.hx index 87d5014e..92df8b98 100644 --- a/tests/generated/src/tests/PerspectiveWarpTests.hx +++ b/tests/generated/src/tests/PerspectiveWarpTests.hx @@ -9,7 +9,7 @@ import vision.ds.Point2D; @:access(vision.algorithms.PerspectiveWarp) class PerspectiveWarpTests { - public static function vision_algorithms_PerspectiveWarp__generateMatrix__ShouldWork():TestResult { + public static function vision_algorithms_PerspectiveWarp__generateMatrix_ArrayPoint2D_ArrayPoint2D_Matrix2D__ShouldWork():TestResult { var result = null; try { var destinationPoints = []; diff --git a/tests/generated/src/tests/PerwittTests.hx b/tests/generated/src/tests/PerwittTests.hx index ed9e3954..d18d9e52 100644 --- a/tests/generated/src/tests/PerwittTests.hx +++ b/tests/generated/src/tests/PerwittTests.hx @@ -10,37 +10,37 @@ import vision.ds.Image; @:access(vision.algorithms.Perwitt) class PerwittTests { - public static function vision_algorithms_Perwitt__detectEdges__ShouldWork():TestResult { + public static function vision_algorithms_Perwitt__convolveWithPerwittOperator_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0.0; - result = vision.algorithms.Perwitt.detectEdges(image, threshold); + result = vision.algorithms.Perwitt.convolveWithPerwittOperator(image); } catch (e) { } return { - testName: "vision.algorithms.Perwitt.detectEdges", + testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Perwitt__convolveWithPerwittOperator__ShouldWork():TestResult { + public static function vision_algorithms_Perwitt__detectEdges_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var threshold = 0.0; - result = vision.algorithms.Perwitt.convolveWithPerwittOperator(image); + result = vision.algorithms.Perwitt.detectEdges(image, threshold); } catch (e) { } return { - testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", + testName: "vision.algorithms.Perwitt.detectEdges", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx index b2999dd6..41cb747f 100644 --- a/tests/generated/src/tests/Point2DTests.hx +++ b/tests/generated/src/tests/Point2DTests.hx @@ -8,7 +8,7 @@ import vision.tools.MathTools; @:access(vision.ds.Point2D) class Point2DTests { - public static function vision_ds_Point2D__toString__ShouldWork():TestResult { + public static function vision_ds_Point2D__toString__String__ShouldWork():TestResult { var result = null; try { var x = 0.0; @@ -29,29 +29,28 @@ class Point2DTests { } } - public static function vision_ds_Point2D__radiansTo__ShouldWork():TestResult { + public static function vision_ds_Point2D__copy__Point2D__ShouldWork():TestResult { var result = null; try { var x = 0.0; var y = 0.0; - var point = new vision.ds.Point2D(0, 0); - + var object = new vision.ds.Point2D(x, y); - result = object.radiansTo(point); + result = object.copy(); } catch (e) { } return { - testName: "vision.ds.Point2D#radiansTo", + testName: "vision.ds.Point2D#copy", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Point2D__distanceTo__ShouldWork():TestResult { + public static function vision_ds_Point2D__distanceTo_Point2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0.0; @@ -73,7 +72,7 @@ class Point2DTests { } } - public static function vision_ds_Point2D__degreesTo__ShouldWork():TestResult { + public static function vision_ds_Point2D__degreesTo_Point2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0.0; @@ -95,21 +94,22 @@ class Point2DTests { } } - public static function vision_ds_Point2D__copy__ShouldWork():TestResult { + public static function vision_ds_Point2D__radiansTo_Point2D_Float__ShouldWork():TestResult { var result = null; try { var x = 0.0; var y = 0.0; - + var point = new vision.ds.Point2D(0, 0); + var object = new vision.ds.Point2D(x, y); - result = object.copy(); + result = object.radiansTo(point); } catch (e) { } return { - testName: "vision.ds.Point2D#copy", + testName: "vision.ds.Point2D#radiansTo", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx index 0d43f0ab..c24b718d 100644 --- a/tests/generated/src/tests/Point3DTests.hx +++ b/tests/generated/src/tests/Point3DTests.hx @@ -8,52 +8,52 @@ import vision.tools.MathTools; @:access(vision.ds.Point3D) class Point3DTests { - public static function vision_ds_Point3D__toString__ShouldWork():TestResult { + public static function vision_ds_Point3D__distanceTo_Point3D_Float__ShouldWork():TestResult { var result = null; try { var x = 0.0; var y = 0.0; var z = 0.0; - + var point:Point3D = null; + var object = new vision.ds.Point3D(x, y, z); - result = object.toString(); + result = object.distanceTo(point); } catch (e) { } return { - testName: "vision.ds.Point3D#toString", + testName: "vision.ds.Point3D#distanceTo", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Point3D__distanceTo__ShouldWork():TestResult { + public static function vision_ds_Point3D__copy__Point3D__ShouldWork():TestResult { var result = null; try { var x = 0.0; var y = 0.0; var z = 0.0; - var point:Point3D = null; - + var object = new vision.ds.Point3D(x, y, z); - result = object.distanceTo(point); + result = object.copy(); } catch (e) { } return { - testName: "vision.ds.Point3D#distanceTo", + testName: "vision.ds.Point3D#copy", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Point3D__copy__ShouldWork():TestResult { + public static function vision_ds_Point3D__toString__String__ShouldWork():TestResult { var result = null; try { var x = 0.0; @@ -62,13 +62,13 @@ class Point3DTests { var object = new vision.ds.Point3D(x, y, z); - result = object.copy(); + result = object.toString(); } catch (e) { } return { - testName: "vision.ds.Point3D#copy", + testName: "vision.ds.Point3D#toString", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/QueueCellTests.hx b/tests/generated/src/tests/QueueCellTests.hx new file mode 100644 index 00000000..df6cd593 --- /dev/null +++ b/tests/generated/src/tests/QueueCellTests.hx @@ -0,0 +1,34 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.QueueCell; + + +@:access(vision.ds.QueueCell) +class QueueCellTests { + public static function vision_ds_QueueCell__getValue__T__ShouldWork():TestResult { + var result = null; + try { + var value = 0; + var next = new vision.ds.QueueCell(0, null, null); + var previous = new vision.ds.QueueCell(0, null, null); + + + var object = new vision.ds.QueueCell(value, next, previous); + result = object.getValue(); + } catch (e) { + + } + + return { + testName: "vision.ds.QueueCell#getValue", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/QueueTests.hx b/tests/generated/src/tests/QueueTests.hx index dc1099ac..4d550da4 100644 --- a/tests/generated/src/tests/QueueTests.hx +++ b/tests/generated/src/tests/QueueTests.hx @@ -26,46 +26,45 @@ class QueueTests { } } - public static function vision_ds_Queue__toString__ShouldWork():TestResult { + public static function vision_ds_Queue__iterator__IteratorT__ShouldWork():TestResult { var result = null; try { var object = new vision.ds.Queue(); - result = object.toString(); + result = object.iterator(); } catch (e) { } return { - testName: "vision.ds.Queue#toString", + testName: "vision.ds.Queue#iterator", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Queue__has__ShouldWork():TestResult { + public static function vision_ds_Queue__dequeue__T__ShouldWork():TestResult { var result = null; try { - var value = 0; - + var object = new vision.ds.Queue(); - result = object.has(value); + result = object.dequeue(); } catch (e) { } return { - testName: "vision.ds.Queue#has", + testName: "vision.ds.Queue#dequeue", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Queue__enqueue__ShouldWork():TestResult { + public static function vision_ds_Queue__enqueue_T_T__ShouldWork():TestResult { var result = null; try { @@ -85,19 +84,39 @@ class QueueTests { } } - public static function vision_ds_Queue__dequeue__ShouldWork():TestResult { + public static function vision_ds_Queue__has_T_Bool__ShouldWork():TestResult { + var result = null; + try { + + var value = 0; + + var object = new vision.ds.Queue(); + result = object.has(value); + } catch (e) { + + } + + return { + testName: "vision.ds.Queue#has", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_Queue__toString__String__ShouldWork():TestResult { var result = null; try { var object = new vision.ds.Queue(); - result = object.dequeue(); + result = object.toString(); } catch (e) { } return { - testName: "vision.ds.Queue#dequeue", + testName: "vision.ds.Queue#toString", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx index e7369b99..0c8e9373 100644 --- a/tests/generated/src/tests/RadixTests.hx +++ b/tests/generated/src/tests/RadixTests.hx @@ -10,7 +10,43 @@ import haxe.Int64; @:access(vision.algorithms.Radix) class RadixTests { - public static function vision_algorithms_Radix__sort__ShouldWork():TestResult { + public static function vision_algorithms_Radix__sort_ArrayInt_ArrayInt__ShouldWork():TestResult { + var result = null; + try { + var main = []; + + result = vision.algorithms.Radix.sort(main); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Radix__sort_ArrayUInt_ArrayUInt__ShouldWork():TestResult { + var result = null; + try { + var main = []; + + result = vision.algorithms.Radix.sort(main); + } catch (e) { + + } + + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_Radix__sort_ArrayInt64_ArrayInt64__ShouldWork():TestResult { var result = null; try { var main = []; diff --git a/tests/generated/src/tests/Ray2DTests.hx b/tests/generated/src/tests/Ray2DTests.hx index d798a598..6c40788c 100644 --- a/tests/generated/src/tests/Ray2DTests.hx +++ b/tests/generated/src/tests/Ray2DTests.hx @@ -52,7 +52,7 @@ class Ray2DTests { } } - public static function vision_ds_Ray2D__from2Points__ShouldWork():TestResult { + public static function vision_ds_Ray2D__from2Points_Point2D_Point2D_Ray2D__ShouldWork():TestResult { var result = null; try { var point1 = new vision.ds.Point2D(0, 0); @@ -71,7 +71,7 @@ class Ray2DTests { } } - public static function vision_ds_Ray2D__intersect__ShouldWork():TestResult { + public static function vision_ds_Ray2D__getPointAtX_Float_Point2D__ShouldWork():TestResult { var result = null; try { var point = new vision.ds.Point2D(0, 0); @@ -79,23 +79,23 @@ class Ray2DTests { var degrees = 0.0; var radians = 0.0; - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var x = 0.0; var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.intersect(ray); + result = object.getPointAtX(x); } catch (e) { } return { - testName: "vision.ds.Ray2D#intersect", + testName: "vision.ds.Ray2D#getPointAtX", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Ray2D__getPointAtY__ShouldWork():TestResult { + public static function vision_ds_Ray2D__getPointAtY_Float_Point2D__ShouldWork():TestResult { var result = null; try { var point = new vision.ds.Point2D(0, 0); @@ -119,7 +119,7 @@ class Ray2DTests { } } - public static function vision_ds_Ray2D__getPointAtX__ShouldWork():TestResult { + public static function vision_ds_Ray2D__intersect_Ray2D_Point2D__ShouldWork():TestResult { var result = null; try { var point = new vision.ds.Point2D(0, 0); @@ -127,23 +127,23 @@ class Ray2DTests { var degrees = 0.0; var radians = 0.0; - var x = 0.0; + var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.getPointAtX(x); + result = object.intersect(ray); } catch (e) { } return { - testName: "vision.ds.Ray2D#getPointAtX", + testName: "vision.ds.Ray2D#intersect", returned: result, expected: null, status: Unimplemented } } - public static function vision_ds_Ray2D__distanceTo__ShouldWork():TestResult { + public static function vision_ds_Ray2D__distanceTo_Ray2D_Float__ShouldWork():TestResult { var result = null; try { var point = new vision.ds.Point2D(0, 0); diff --git a/tests/generated/src/tests/RobertsCrossTests.hx b/tests/generated/src/tests/RobertsCrossTests.hx index 9e53208b..3cc3e7ec 100644 --- a/tests/generated/src/tests/RobertsCrossTests.hx +++ b/tests/generated/src/tests/RobertsCrossTests.hx @@ -9,7 +9,7 @@ import vision.ds.Image; @:access(vision.algorithms.RobertsCross) class RobertsCrossTests { - public static function vision_algorithms_RobertsCross__convolveWithRobertsCross__ShouldWork():TestResult { + public static function vision_algorithms_RobertsCross__convolveWithRobertsCross_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); diff --git a/tests/generated/src/tests/SimpleHoughTests.hx b/tests/generated/src/tests/SimpleHoughTests.hx index 814c45cd..ae7355a2 100644 --- a/tests/generated/src/tests/SimpleHoughTests.hx +++ b/tests/generated/src/tests/SimpleHoughTests.hx @@ -10,7 +10,26 @@ import vision.ds.Image; @:access(vision.algorithms.SimpleHough) class SimpleHoughTests { - public static function vision_algorithms_SimpleHough__mapLines__ShouldWork():TestResult { + public static function vision_algorithms_SimpleHough__detectLines_Image_Int_ArrayRay2D__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var threshold = 0; + + result = vision.algorithms.SimpleHough.detectLines(image, threshold); + } catch (e) { + + } + + return { + testName: "vision.algorithms.SimpleHough.detectLines", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_algorithms_SimpleHough__mapLines_Image_ArrayRay2D_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); diff --git a/tests/generated/src/tests/SimpleLineDetectorTests.hx b/tests/generated/src/tests/SimpleLineDetectorTests.hx index 53787f56..f629d9a5 100644 --- a/tests/generated/src/tests/SimpleLineDetectorTests.hx +++ b/tests/generated/src/tests/SimpleLineDetectorTests.hx @@ -12,26 +12,29 @@ import vision.ds.IntPoint2D; @:access(vision.algorithms.SimpleLineDetector) class SimpleLineDetectorTests { - public static function vision_algorithms_SimpleLineDetector__p__ShouldWork():TestResult { + public static function vision_algorithms_SimpleLineDetector__findLineFromPoint_Image_Int16Point2D_Float_Bool_Bool_Line2D__ShouldWork():TestResult { var result = null; try { - var x = 0; - var y = 0; + var image = new vision.ds.Image(100, 100); + var point = new vision.ds.Int16Point2D(0, 0); + var minLineLength = 0.0; + var preferTTB = false; + var preferRTL = false; - result = vision.algorithms.SimpleLineDetector.p(x, y); + result = vision.algorithms.SimpleLineDetector.findLineFromPoint(image, point, minLineLength, preferTTB, preferRTL); } catch (e) { } return { - testName: "vision.algorithms.SimpleLineDetector.p", + testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage__ShouldWork():TestResult { + public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage_Image_Line2D_Float__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); @@ -50,22 +53,20 @@ class SimpleLineDetectorTests { } } - public static function vision_algorithms_SimpleLineDetector__findLineFromPoint__ShouldWork():TestResult { + public static function vision_algorithms_SimpleLineDetector__correctLines_ArrayLine2D_Float_Float_ArrayLine2D__ShouldWork():TestResult { var result = null; try { - var image = new vision.ds.Image(100, 100); - var point = new vision.ds.Int16Point2D(0, 0); - var minLineLength = 0.0; - var preferTTB = false; - var preferRTL = false; + var lines = []; + var distanceThreshold = 0.0; + var degError = 0.0; - result = vision.algorithms.SimpleLineDetector.findLineFromPoint(image, point, minLineLength, preferTTB, preferRTL); + result = vision.algorithms.SimpleLineDetector.correctLines(lines, distanceThreshold, degError); } catch (e) { } return { - testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", + testName: "vision.algorithms.SimpleLineDetector.correctLines", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/SobelTests.hx b/tests/generated/src/tests/SobelTests.hx index 491048eb..cc496c3b 100644 --- a/tests/generated/src/tests/SobelTests.hx +++ b/tests/generated/src/tests/SobelTests.hx @@ -10,37 +10,37 @@ import vision.ds.Image; @:access(vision.algorithms.Sobel) class SobelTests { - public static function vision_algorithms_Sobel__detectEdges__ShouldWork():TestResult { + public static function vision_algorithms_Sobel__convolveWithSobelOperator_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0.0; - result = vision.algorithms.Sobel.detectEdges(image, threshold); + result = vision.algorithms.Sobel.convolveWithSobelOperator(image); } catch (e) { } return { - testName: "vision.algorithms.Sobel.detectEdges", + testName: "vision.algorithms.Sobel.convolveWithSobelOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_algorithms_Sobel__convolveWithSobelOperator__ShouldWork():TestResult { + public static function vision_algorithms_Sobel__detectEdges_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var threshold = 0.0; - result = vision.algorithms.Sobel.convolveWithSobelOperator(image); + result = vision.algorithms.Sobel.detectEdges(image, threshold); } catch (e) { } return { - testName: "vision.algorithms.Sobel.convolveWithSobelOperator", + testName: "vision.algorithms.Sobel.detectEdges", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/TransformationMatrix2DTests.hx b/tests/generated/src/tests/TransformationMatrix2DTests.hx new file mode 100644 index 00000000..86a2c36c --- /dev/null +++ b/tests/generated/src/tests/TransformationMatrix2DTests.hx @@ -0,0 +1,226 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.ds.TransformationMatrix2D; +import vision.ds.Matrix2D; +import vision.ds.Point3D; + +@:access(vision.ds.TransformationMatrix2D) +class TransformationMatrix2DTests { + public static function vision_ds_TransformationMatrix2D__underlying__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.underlying; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#underlying", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__a__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.a; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#a", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__b__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.b; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#b", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__c__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.c; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#c", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__d__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.d; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#d", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__e__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.e; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#e", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__f__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.f; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#f", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__tx__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.tx; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#tx", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__ty__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.ty; + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#ty", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__transformPoint_Point3D_Point3D__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var point:Point3D = null; + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.transformPoint(point); + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_ds_TransformationMatrix2D__transformPoint_Point2D_Point2D__ShouldWork():TestResult { + var result = null; + try { + var m:Matrix2D = null; + + var point = new vision.ds.Point2D(0, 0); + + var object = new vision.ds.TransformationMatrix2D(m); + result = object.transformPoint(point); + } catch (e) { + + } + + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx index 784edf71..98240e24 100644 --- a/tests/generated/src/tests/UInt16Point2DTests.hx +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -48,7 +48,7 @@ class UInt16Point2DTests { } } - public static function vision_ds_UInt16Point2D__toString__ShouldWork():TestResult { + public static function vision_ds_UInt16Point2D__toString__String__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -69,7 +69,7 @@ class UInt16Point2DTests { } } - public static function vision_ds_UInt16Point2D__toPoint2D__ShouldWork():TestResult { + public static function vision_ds_UInt16Point2D__toPoint2D__Point2D__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -90,7 +90,7 @@ class UInt16Point2DTests { } } - public static function vision_ds_UInt16Point2D__toIntPoint2D__ShouldWork():TestResult { + public static function vision_ds_UInt16Point2D__toIntPoint2D__Point2D__ShouldWork():TestResult { var result = null; try { var X = 0; @@ -111,7 +111,7 @@ class UInt16Point2DTests { } } - public static function vision_ds_UInt16Point2D__toInt__ShouldWork():TestResult { + public static function vision_ds_UInt16Point2D__toInt__Int__ShouldWork():TestResult { var result = null; try { var X = 0; diff --git a/tests/generated/src/tests/VisionTests.hx b/tests/generated/src/tests/VisionTests.hx index ddb0ae24..678541fc 100644 --- a/tests/generated/src/tests/VisionTests.hx +++ b/tests/generated/src/tests/VisionTests.hx @@ -51,303 +51,301 @@ import vision.tools.MathTools.*; @:access(vision.Vision) class VisionTests { - public static function vision_Vision__whiteNoise__ShouldWork():TestResult { + public static function vision_Vision__combine_Image_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var with = new vision.ds.Image(100, 100); var percentage = 0.0; - var whiteNoiseRange:WhiteNoiseRange = null; - result = vision.Vision.whiteNoise(image, percentage, whiteNoiseRange); + result = vision.Vision.combine(image, with, percentage); } catch (e) { } return { - testName: "vision.Vision.whiteNoise", + testName: "vision.Vision.combine", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__vignette__ShouldWork():TestResult { + public static function vision_Vision__tint_Image_Color_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var strength = 0.0; - var intensity = 0.0; - var ratioDependent = false; - var color:Color = null; + var withColor:Color = null; + var percentage = 0.0; - result = vision.Vision.vignette(image, strength, intensity, ratioDependent, color); + result = vision.Vision.tint(image, withColor, percentage); } catch (e) { } return { - testName: "vision.Vision.vignette", + testName: "vision.Vision.tint", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__tint__ShouldWork():TestResult { + public static function vision_Vision__grayscale_Image_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var withColor:Color = null; - var percentage = 0.0; + var simpleGrayscale = false; - result = vision.Vision.tint(image, withColor, percentage); + result = vision.Vision.grayscale(image, simpleGrayscale); } catch (e) { } return { - testName: "vision.Vision.tint", + testName: "vision.Vision.grayscale", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__sobelEdgeDiffOperator__ShouldWork():TestResult { + public static function vision_Vision__invert_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.sobelEdgeDiffOperator(image); + result = vision.Vision.invert(image); } catch (e) { } return { - testName: "vision.Vision.sobelEdgeDiffOperator", + testName: "vision.Vision.invert", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__sobelEdgeDetection__ShouldWork():TestResult { + public static function vision_Vision__sepia_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0.0; + var strength = 0.0; - result = vision.Vision.sobelEdgeDetection(image, threshold); + result = vision.Vision.sepia(image, strength); } catch (e) { } return { - testName: "vision.Vision.sobelEdgeDetection", + testName: "vision.Vision.sepia", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__smooth__ShouldWork():TestResult { + public static function vision_Vision__blackAndWhite_Image_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var strength = 0.0; - var affectAlpha = false; - var kernelRadius = 0; - var circularKernel = false; - var iterations = 0; + var threshold = 0; - result = vision.Vision.smooth(image, strength, affectAlpha, kernelRadius, circularKernel, iterations); + result = vision.Vision.blackAndWhite(image, threshold); } catch (e) { } return { - testName: "vision.Vision.smooth", + testName: "vision.Vision.blackAndWhite", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__simpleImageSimilarity__ShouldWork():TestResult { + public static function vision_Vision__contrast_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var compared = new vision.ds.Image(100, 100); - var scoringMechanism:SimilarityScoringMechanism = null; - result = vision.Vision.simpleImageSimilarity(image, compared, scoringMechanism); + result = vision.Vision.contrast(image); } catch (e) { } return { - testName: "vision.Vision.simpleImageSimilarity", + testName: "vision.Vision.contrast", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__sharpen__ShouldWork():TestResult { + public static function vision_Vision__smooth_Image_Float_Bool_Int_Bool_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var strength = 0.0; + var affectAlpha = false; + var kernelRadius = 0; + var circularKernel = false; + var iterations = 0; - result = vision.Vision.sharpen(image); + result = vision.Vision.smooth(image, strength, affectAlpha, kernelRadius, circularKernel, iterations); } catch (e) { } return { - testName: "vision.Vision.sharpen", + testName: "vision.Vision.smooth", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__sepia__ShouldWork():TestResult { + public static function vision_Vision__pixelate_Image_Bool_Int_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var strength = 0.0; + var averagePixels = false; + var pixelSize = 0; + var affectAlpha = false; - result = vision.Vision.sepia(image, strength); + result = vision.Vision.pixelate(image, averagePixels, pixelSize, affectAlpha); } catch (e) { } return { - testName: "vision.Vision.sepia", + testName: "vision.Vision.pixelate", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__saltAndPepperNoise__ShouldWork():TestResult { + public static function vision_Vision__posterize_Image_Int_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var percentage = 0.0; + var bitsPerChannel = 0; + var affectAlpha = false; - result = vision.Vision.saltAndPepperNoise(image, percentage); + result = vision.Vision.posterize(image, bitsPerChannel, affectAlpha); } catch (e) { } return { - testName: "vision.Vision.saltAndPepperNoise", + testName: "vision.Vision.posterize", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__robertEdgeDiffOperator__ShouldWork():TestResult { + public static function vision_Vision__sharpen_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.robertEdgeDiffOperator(image); + result = vision.Vision.sharpen(image); } catch (e) { } return { - testName: "vision.Vision.robertEdgeDiffOperator", + testName: "vision.Vision.sharpen", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__replaceColorRanges__ShouldWork():TestResult { + public static function vision_Vision__deepfry_Image_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var ranges = []; + var iterations = 0; - result = vision.Vision.replaceColorRanges(image, ranges); + result = vision.Vision.deepfry(image, iterations); } catch (e) { } return { - testName: "vision.Vision.replaceColorRanges", + testName: "vision.Vision.deepfry", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__projectiveTransform__ShouldWork():TestResult { + public static function vision_Vision__vignette_Image_Float_Float_Bool_Color_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var matrix:TransformationMatrix2D = null; - var expansionMode:ImageExpansionMode = null; + var strength = 0.0; + var intensity = 0.0; + var ratioDependent = false; + var color:Color = null; - result = vision.Vision.projectiveTransform(image, matrix, expansionMode); + result = vision.Vision.vignette(image, strength, intensity, ratioDependent, color); } catch (e) { } return { - testName: "vision.Vision.projectiveTransform", + testName: "vision.Vision.vignette", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__posterize__ShouldWork():TestResult { + public static function vision_Vision__fisheyeDistortion_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var bitsPerChannel = 0; - var affectAlpha = false; + var strength = 0.0; - result = vision.Vision.posterize(image, bitsPerChannel, affectAlpha); + result = vision.Vision.fisheyeDistortion(image, strength); } catch (e) { } return { - testName: "vision.Vision.posterize", + testName: "vision.Vision.fisheyeDistortion", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__pixelate__ShouldWork():TestResult { + public static function vision_Vision__barrelDistortion_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var averagePixels = false; - var pixelSize = 0; - var affectAlpha = false; + var strength = 0.0; - result = vision.Vision.pixelate(image, averagePixels, pixelSize, affectAlpha); + result = vision.Vision.barrelDistortion(image, strength); } catch (e) { } return { - testName: "vision.Vision.pixelate", + testName: "vision.Vision.barrelDistortion", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__pincushionDistortion__ShouldWork():TestResult { + public static function vision_Vision__pincushionDistortion_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); @@ -366,121 +364,147 @@ class VisionTests { } } - public static function vision_Vision__perwittEdgeDiffOperator__ShouldWork():TestResult { + public static function vision_Vision__mustacheDistortion_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var amplitude = 0.0; - result = vision.Vision.perwittEdgeDiffOperator(image); + result = vision.Vision.mustacheDistortion(image, amplitude); } catch (e) { } return { - testName: "vision.Vision.perwittEdgeDiffOperator", + testName: "vision.Vision.mustacheDistortion", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__perwittEdgeDetection__ShouldWork():TestResult { + public static function vision_Vision__dilate_Image_Int_ColorImportanceOrder_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0.0; + var dilationRadius = 0; + var colorImportanceOrder:ColorImportanceOrder = null; + var circularKernel = false; - result = vision.Vision.perwittEdgeDetection(image, threshold); + result = vision.Vision.dilate(image, dilationRadius, colorImportanceOrder, circularKernel); } catch (e) { } return { - testName: "vision.Vision.perwittEdgeDetection", + testName: "vision.Vision.dilate", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__normalize__ShouldWork():TestResult { + public static function vision_Vision__erode_Image_Int_ColorImportanceOrder_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var rangeStart:Color = null; - var rangeEnd:Color = null; + var erosionRadius = 0; + var colorImportanceOrder:ColorImportanceOrder = null; + var circularKernel = false; - result = vision.Vision.normalize(image, rangeStart, rangeEnd); + result = vision.Vision.erode(image, erosionRadius, colorImportanceOrder, circularKernel); } catch (e) { } return { - testName: "vision.Vision.normalize", + testName: "vision.Vision.erode", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__nearestNeighborBlur__ShouldWork():TestResult { + public static function vision_Vision__saltAndPepperNoise_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var iterations = 0; + var percentage = 0.0; - result = vision.Vision.nearestNeighborBlur(image, iterations); + result = vision.Vision.saltAndPepperNoise(image, percentage); } catch (e) { } return { - testName: "vision.Vision.nearestNeighborBlur", + testName: "vision.Vision.saltAndPepperNoise", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__mustacheDistortion__ShouldWork():TestResult { + public static function vision_Vision__dropOutNoise_Image_Float_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var amplitude = 0.0; + var percentage = 0.0; + var threshold = 0; - result = vision.Vision.mustacheDistortion(image, amplitude); + result = vision.Vision.dropOutNoise(image, percentage, threshold); } catch (e) { } return { - testName: "vision.Vision.mustacheDistortion", + testName: "vision.Vision.dropOutNoise", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__medianBlur__ShouldWork():TestResult { + public static function vision_Vision__whiteNoise_Image_Float_WhiteNoiseRange_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var kernelSize = 0; + var percentage = 0.0; + var whiteNoiseRange:WhiteNoiseRange = null; - result = vision.Vision.medianBlur(image, kernelSize); + result = vision.Vision.whiteNoise(image, percentage, whiteNoiseRange); } catch (e) { } return { - testName: "vision.Vision.medianBlur", + testName: "vision.Vision.whiteNoise", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__normalize_Image_Color_Color_Image__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var rangeStart:Color = null; + var rangeEnd:Color = null; + + result = vision.Vision.normalize(image, rangeStart, rangeEnd); + } catch (e) { + + } + + return { + testName: "vision.Vision.normalize", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__limitColorRanges__ShouldWork():TestResult { + public static function vision_Vision__limitColorRanges_Image_Color_Color_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); @@ -500,363 +524,362 @@ class VisionTests { } } - public static function vision_Vision__laplacianOfGaussianEdgeDetection__ShouldWork():TestResult { + public static function vision_Vision__replaceColorRanges_Image_ArrayrangeStartColorrangeEndColorreplacementColor_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0; - var filterPositive = false; - var sigma = 0.0; - var kernelSize:GaussianKernelSize = null; + var ranges = []; - result = vision.Vision.laplacianOfGaussianEdgeDetection(image, threshold, filterPositive, sigma, kernelSize); + result = vision.Vision.replaceColorRanges(image, ranges); } catch (e) { } return { - testName: "vision.Vision.laplacianOfGaussianEdgeDetection", + testName: "vision.Vision.replaceColorRanges", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__laplacianEdgeDiffOperator__ShouldWork():TestResult { + public static function vision_Vision__filterForColorChannel_Image_ColorChannel_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var filterPositive = false; + var channel:ColorChannel = null; - result = vision.Vision.laplacianEdgeDiffOperator(image, filterPositive); + result = vision.Vision.filterForColorChannel(image, channel); } catch (e) { } return { - testName: "vision.Vision.laplacianEdgeDiffOperator", + testName: "vision.Vision.filterForColorChannel", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__kmeansPosterize__ShouldWork():TestResult { + public static function vision_Vision__convolve_Image_EitherTypeKernel2DArrayArrayFloat_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var maxColorCount = 0; + var kernel:EitherType>> = null; - result = vision.Vision.kmeansPosterize(image, maxColorCount); + result = vision.Vision.convolve(image, kernel); } catch (e) { } return { - testName: "vision.Vision.kmeansPosterize", + testName: "vision.Vision.convolve", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__invert__ShouldWork():TestResult { + public static function vision_Vision__affineTransform_Image_TransformationMatrix2D_ImageExpansionMode_Point2D_TransformationMatrixOrigination_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var matrix:TransformationMatrix2D = null; + var expansionMode:ImageExpansionMode = null; + var originPoint = new vision.ds.Point2D(0, 0); + var originMode:TransformationMatrixOrigination = null; - result = vision.Vision.invert(image); + result = vision.Vision.affineTransform(image, matrix, expansionMode, originPoint, originMode); } catch (e) { } return { - testName: "vision.Vision.invert", + testName: "vision.Vision.affineTransform", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__grayscale__ShouldWork():TestResult { + public static function vision_Vision__projectiveTransform_Image_TransformationMatrix2D_ImageExpansionMode_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var simpleGrayscale = false; + var matrix:TransformationMatrix2D = null; + var expansionMode:ImageExpansionMode = null; - result = vision.Vision.grayscale(image, simpleGrayscale); + result = vision.Vision.projectiveTransform(image, matrix, expansionMode); } catch (e) { } return { - testName: "vision.Vision.grayscale", + testName: "vision.Vision.projectiveTransform", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__gaussianBlur__ShouldWork():TestResult { + public static function vision_Vision__nearestNeighborBlur_Image_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var sigma = 0.0; - var kernelSize:GaussianKernelSize = null; - var fast = false; + var iterations = 0; - result = vision.Vision.gaussianBlur(image, sigma, kernelSize, fast); + result = vision.Vision.nearestNeighborBlur(image, iterations); } catch (e) { } return { - testName: "vision.Vision.gaussianBlur", + testName: "vision.Vision.nearestNeighborBlur", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__fisheyeDistortion__ShouldWork():TestResult { + public static function vision_Vision__gaussianBlur_Image_Float_GaussianKernelSize_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var strength = 0.0; + var sigma = 0.0; + var kernelSize:GaussianKernelSize = null; + var fast = false; - result = vision.Vision.fisheyeDistortion(image, strength); + result = vision.Vision.gaussianBlur(image, sigma, kernelSize, fast); } catch (e) { } return { - testName: "vision.Vision.fisheyeDistortion", + testName: "vision.Vision.gaussianBlur", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__filterForColorChannel__ShouldWork():TestResult { + public static function vision_Vision__medianBlur_Image_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var channel:ColorChannel = null; + var kernelSize = 0; - result = vision.Vision.filterForColorChannel(image, channel); + result = vision.Vision.medianBlur(image, kernelSize); } catch (e) { } return { - testName: "vision.Vision.filterForColorChannel", + testName: "vision.Vision.medianBlur", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__erode__ShouldWork():TestResult { + public static function vision_Vision__simpleLine2DDetection_Image_Float_Float_AlgorithmSettings_ArrayLine2D__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var erosionRadius = 0; - var colorImportanceOrder:ColorImportanceOrder = null; - var circularKernel = false; + var accuracy = 0.0; + var minLineLength = 0.0; + var speedToAccuracyRatio:AlgorithmSettings = null; - result = vision.Vision.erode(image, erosionRadius, colorImportanceOrder, circularKernel); + result = vision.Vision.simpleLine2DDetection(image, accuracy, minLineLength, speedToAccuracyRatio); } catch (e) { } return { - testName: "vision.Vision.erode", + testName: "vision.Vision.simpleLine2DDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__dropOutNoise__ShouldWork():TestResult { + public static function vision_Vision__sobelEdgeDiffOperator_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var percentage = 0.0; - var threshold = 0; - result = vision.Vision.dropOutNoise(image, percentage, threshold); + result = vision.Vision.sobelEdgeDiffOperator(image); } catch (e) { } return { - testName: "vision.Vision.dropOutNoise", + testName: "vision.Vision.sobelEdgeDiffOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__dilate__ShouldWork():TestResult { + public static function vision_Vision__perwittEdgeDiffOperator_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var dilationRadius = 0; - var colorImportanceOrder:ColorImportanceOrder = null; - var circularKernel = false; - result = vision.Vision.dilate(image, dilationRadius, colorImportanceOrder, circularKernel); + result = vision.Vision.perwittEdgeDiffOperator(image); } catch (e) { } return { - testName: "vision.Vision.dilate", + testName: "vision.Vision.perwittEdgeDiffOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__deepfry__ShouldWork():TestResult { + public static function vision_Vision__robertEdgeDiffOperator_Image_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var iterations = 0; - result = vision.Vision.deepfry(image, iterations); + result = vision.Vision.robertEdgeDiffOperator(image); } catch (e) { } return { - testName: "vision.Vision.deepfry", + testName: "vision.Vision.robertEdgeDiffOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__convolve__ShouldWork():TestResult { + public static function vision_Vision__laplacianEdgeDiffOperator_Image_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var kernel:EitherType>> = null; + var filterPositive = false; - result = vision.Vision.convolve(image, kernel); + result = vision.Vision.laplacianEdgeDiffOperator(image, filterPositive); } catch (e) { } return { - testName: "vision.Vision.convolve", + testName: "vision.Vision.laplacianEdgeDiffOperator", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__convolutionRidgeDetection__ShouldWork():TestResult { + public static function vision_Vision__cannyEdgeDetection_Image_Float_GaussianKernelSize_Float_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var normalizationRangeStart:Color = null; - var normalizationRangeEnd:Color = null; - var refine = false; + var sigma = 0.0; + var kernelSize:GaussianKernelSize = null; + var lowThreshold = 0.0; + var highThreshold = 0.0; - result = vision.Vision.convolutionRidgeDetection(image, normalizationRangeStart, normalizationRangeEnd, refine); + result = vision.Vision.cannyEdgeDetection(image, sigma, kernelSize, lowThreshold, highThreshold); } catch (e) { } return { - testName: "vision.Vision.convolutionRidgeDetection", + testName: "vision.Vision.cannyEdgeDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__contrast__ShouldWork():TestResult { + public static function vision_Vision__sobelEdgeDetection_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var threshold = 0.0; - result = vision.Vision.contrast(image); + result = vision.Vision.sobelEdgeDetection(image, threshold); } catch (e) { } return { - testName: "vision.Vision.contrast", + testName: "vision.Vision.sobelEdgeDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__combine__ShouldWork():TestResult { + public static function vision_Vision__perwittEdgeDetection_Image_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var with = new vision.ds.Image(100, 100); - var percentage = 0.0; + var threshold = 0.0; - result = vision.Vision.combine(image, with, percentage); + result = vision.Vision.perwittEdgeDetection(image, threshold); } catch (e) { } return { - testName: "vision.Vision.combine", + testName: "vision.Vision.perwittEdgeDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__cannyEdgeDetection__ShouldWork():TestResult { + public static function vision_Vision__laplacianOfGaussianEdgeDetection_Image_Int_Bool_Float_GaussianKernelSize_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); + var threshold = 0; + var filterPositive = false; var sigma = 0.0; var kernelSize:GaussianKernelSize = null; - var lowThreshold = 0.0; - var highThreshold = 0.0; - result = vision.Vision.cannyEdgeDetection(image, sigma, kernelSize, lowThreshold, highThreshold); + result = vision.Vision.laplacianOfGaussianEdgeDetection(image, threshold, filterPositive, sigma, kernelSize); } catch (e) { } return { - testName: "vision.Vision.cannyEdgeDetection", + testName: "vision.Vision.laplacianOfGaussianEdgeDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__blackAndWhite__ShouldWork():TestResult { + public static function vision_Vision__convolutionRidgeDetection_Image_Color_Color_Bool_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var threshold = 0; + var normalizationRangeStart:Color = null; + var normalizationRangeEnd:Color = null; + var refine = false; - result = vision.Vision.blackAndWhite(image, threshold); + result = vision.Vision.convolutionRidgeDetection(image, normalizationRangeStart, normalizationRangeEnd, refine); } catch (e) { } return { - testName: "vision.Vision.blackAndWhite", + testName: "vision.Vision.convolutionRidgeDetection", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__bilateralDenoise__ShouldWork():TestResult { + public static function vision_Vision__bilateralDenoise_Image_Float_Float_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); @@ -876,41 +899,59 @@ class VisionTests { } } - public static function vision_Vision__barrelDistortion__ShouldWork():TestResult { + public static function vision_Vision__simpleImageSimilarity_Image_Image_SimilarityScoringMechanism_Float__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var strength = 0.0; + var compared = new vision.ds.Image(100, 100); + var scoringMechanism:SimilarityScoringMechanism = null; - result = vision.Vision.barrelDistortion(image, strength); + result = vision.Vision.simpleImageSimilarity(image, compared, scoringMechanism); } catch (e) { } return { - testName: "vision.Vision.barrelDistortion", + testName: "vision.Vision.simpleImageSimilarity", returned: result, expected: null, status: Unimplemented } } - public static function vision_Vision__affineTransform__ShouldWork():TestResult { + public static function vision_Vision__kmeansPosterize_Image_Int_Image__ShouldWork():TestResult { var result = null; try { var image = new vision.ds.Image(100, 100); - var matrix:TransformationMatrix2D = null; - var expansionMode:ImageExpansionMode = null; - var originPoint = new vision.ds.Point2D(0, 0); - var originMode:TransformationMatrixOrigination = null; + var maxColorCount = 0; - result = vision.Vision.affineTransform(image, matrix, expansionMode, originPoint, originMode); + result = vision.Vision.kmeansPosterize(image, maxColorCount); } catch (e) { } return { - testName: "vision.Vision.affineTransform", + testName: "vision.Vision.kmeansPosterize", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_Vision__kmeansGroupImageColors_Image_Int_Bool_ArrayColorCluster__ShouldWork():TestResult { + var result = null; + try { + var image = new vision.ds.Image(100, 100); + var groupCount = 0; + var considerTransparency = false; + + result = vision.Vision.kmeansGroupImageColors(image, groupCount, considerTransparency); + } catch (e) { + + } + + return { + testName: "vision.Vision.kmeansGroupImageColors", returned: result, expected: null, status: Unimplemented diff --git a/tests/generated/src/tests/VisionThreadTests.hx b/tests/generated/src/tests/VisionThreadTests.hx new file mode 100644 index 00000000..094ce190 --- /dev/null +++ b/tests/generated/src/tests/VisionThreadTests.hx @@ -0,0 +1,51 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.helpers.VisionThread; +import vision.exceptions.MultithreadFailure; +import haxe.Exception; + +@:access(vision.helpers.VisionThread) +class VisionThreadTests { + public static function vision_helpers_VisionThread__create_VoidVoid_VisionThread__ShouldWork():TestResult { + var result = null; + try { + var job = () -> return; + + result = vision.helpers.VisionThread.create(job); + } catch (e) { + + } + + return { + testName: "vision.helpers.VisionThread.create", + returned: result, + expected: null, + status: Unimplemented + } + } + + public static function vision_helpers_VisionThread__start__ShouldWork():TestResult { + var result = null; + try { + var job = () -> return; + + + var object = new vision.helpers.VisionThread(job); + object.start(); + } catch (e) { + + } + + return { + testName: "vision.helpers.VisionThread#start", + returned: result, + expected: null, + status: Unimplemented + } + } + + +} \ No newline at end of file diff --git a/tests/generator/Detector.hx b/tests/generator/Detector.hx index e5484553..8e903dac 100644 --- a/tests/generator/Detector.hx +++ b/tests/generator/Detector.hx @@ -3,15 +3,17 @@ package; import sys.io.File; import sys.FileSystem; +using StringTools; + class Detector { static var packageFinder = ~/^package ([\w.]+)/m; static var importFinder = ~/^import ([\w.*]+)/m; static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; - static var staticFunctionFinder = ~/static.+?function (\w+)(?:)?\((.*)\)(?::\w+)?\s*(?:$|{)/m; - static var staticFieldFinder = ~/static.+?(?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFieldFinder = ~/(?:public inline|inline public|public) (?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFunctionFinder = ~/(?:public inline|inline public|public) function (\w+)(?:)?\((.*)\)(?::\w+)?\s*(?:$|{)/m; + static var staticFunctionFinder = ~/public static (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; + static var staticFieldFinder = ~/public static (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFieldFinder = ~/public (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFunctionFinder = ~/public (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; static var constructorFinder = ~/function new\s*\((.*)\)/; public static function detectOnFile(pathToHaxeFile:String):TestDetections { @@ -39,13 +41,16 @@ class Detector { originalFileContent = fileContent; - var staticFunctions = new Map(); + var staticFunctions = new Map<{name:String, type:String}, String>(); while (staticFunctionFinder.match(fileContent)) { var functionName = staticFunctionFinder.matched(1); var functionParameters = staticFunctionFinder.matched(2); + var functionReturnType = staticFunctionFinder.matched(3).trim(); + if (functionReturnType == "") functionReturnType = "Void"; + fileContent = staticFunctionFinder.matchedRight(); - staticFunctions.set(functionName, functionParameters); + staticFunctions.set({name: functionName, type: functionReturnType}, functionParameters); } fileContent = originalFileContent; @@ -60,18 +65,21 @@ class Detector { fileContent = originalFileContent; - var instanceFunctions = new Map(); + var instanceFunctions = new Map<{name:String, type:String}, String>(); while (instanceFunctionFinder.match(fileContent)) { var functionName = instanceFunctionFinder.matched(1); var functionParameters = instanceFunctionFinder.matched(2); + var functionReturnType = instanceFunctionFinder.matched(3).trim(); + if (functionReturnType == "") functionReturnType = "Void"; + fileContent = instanceFunctionFinder.matchedRight(); if (functionName == "new") { continue; } - instanceFunctions.set(functionName, functionParameters); + instanceFunctions.set({name: functionName, type: functionReturnType}, functionParameters); } fileContent = originalFileContent; @@ -111,8 +119,8 @@ typedef TestDetections = { imports:Array, className:String, constructorParameters:Array, - staticFunctions:Map, + staticFunctions:Map<{name:String, type:String}, String>, staticFields:Array, - instanceFunctions:Map, + instanceFunctions:Map<{name:String, type:String}, String>, instanceFields:Array } \ No newline at end of file diff --git a/tests/generator/Generator.hx b/tests/generator/Generator.hx index 45538e8e..e564b4c0 100644 --- a/tests/generator/Generator.hx +++ b/tests/generator/Generator.hx @@ -1,5 +1,6 @@ package; +import vision.tools.ArrayTools; import Detector.TestDetections; import sys.FileSystem; import sys.io.File; @@ -33,6 +34,7 @@ class Generator { packageName: detections.packageName, className: detections.className, fieldName: field, + fieldType: "", testGoal: "ShouldWork", parameters: extractParameters(""), constructorParameters: extractParameters(""), @@ -45,6 +47,7 @@ class Generator { packageName: detections.packageName, className: detections.className, fieldName: field, + fieldType: "", testGoal: "ShouldWork", parameters: extractParameters(""), constructorParameters: extractParameters(detections.constructorParameters[0] ?? "") @@ -55,7 +58,8 @@ class Generator { file.writeString(generateTest(staticFunctionTemplate, { packageName: detections.packageName, className: detections.className, - fieldName: method, + fieldName: method.name, + fieldType: method.type, testGoal: "ShouldWork", parameters: extractParameters(parameters), constructorParameters: extractParameters("") @@ -66,7 +70,8 @@ class Generator { file.writeString(generateTest(instanceFunctionTemplate, { packageName: detections.packageName, className: detections.className, - fieldName: method, + fieldName: method.name, + fieldType: method.type, testGoal: "ShouldWork", parameters: extractParameters(parameters), constructorParameters: extractParameters(detections.constructorParameters[0] ?? "") @@ -95,6 +100,11 @@ class Generator { static function generateTest(template:String, testBase:TestBase):String { var cleanPackage = testBase.packageName.replace(".", "_") + '_${testBase.className}'; + if (testBase.fieldType == "Void") { + template = template.replace("result = ", "").replace("var null", "var result = null"); + } else if (testBase.fieldType != "") { + template = template.replace("X2__", 'X2_${~/[^a-zA-Z0-9_]/g.replace('${testBase.parameters.types}_${testBase.fieldType}', "")}__'); + } return template .replace("X1", cleanPackage) .replace("X2", testBase.fieldName) @@ -129,20 +139,25 @@ class Generator { } - static function extractParameters(parameters:String):{declarations:String, injection:String} { - var regex = ~/(\w+):((?:\(.+?\)\s*->\s*\w+)|(?:\w+\s*->\s*\w+)|(?:(?:EitherType|Map)<.+, .+>)|(?:\w+<\{.+\}>)|(?:\w+<\w+>)|(?:\w|\.)+|\{.+\}),?/; - var output = {declarations: "", injection: []} + static function extractParameters(parameters:String):{declarations:String, injection:String, types:String} { + if (parameters.contains("average")) { + trace(parameters); + } + var regex = ~/(\w+):((?:\(.+?\)\s*->\s*\w+)|(?:\w+(?:<\w+>)?\s*->\s*\w+)|(?:(?:EitherType|Map)<.+, .+>)|(?:\w+(?:<\{.+\}>|<\w+>))|(?:\w|\.)+|\{.+\}),?/; + var output = {declarations: "", injection: [], types: []} while (regex.match(parameters)) { var name = regex.matched(1); var type = regex.matched(2); parameters = regex.matchedRight(); output.declarations += 'var $name${getDefaultValueOf(type) == "null" ? ':$type' : ""} = ${getDefaultValueOf(type)};\n\t\t\t'; output.injection.push(name); + output.types.push(type); } return { declarations: output.declarations, - injection: output.injection.join(", ") + injection: output.injection.join(", "), + types: output.types.join("_") }; } @@ -152,6 +167,11 @@ class Generator { case "Int": "0"; case "Float": "0.0"; case "Bool": "false"; + case "() -> Void" | "Void->Void": "() -> return"; + case "Array->T": "(_) -> null"; + case (_.contains("->") => true): + var commas = valueType.split("->")[0].split(",").length; + '(${[for (i in 0...commas) "_"].join(", ")}) -> null'; case (_.startsWith("Array") || _.startsWith("Map") => true): "[]"; case "Point2D" | "IntPoint2D" | "Int16Point2D" | "UInt16Point2D": 'new vision.ds.$valueType(0, 0)'; case "Line2D": 'new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10})'; @@ -160,9 +180,7 @@ class Generator { case "Image": 'new vision.ds.Image(100, 100)'; case "T": "0"; // A little insane but should work in most cases so idk case (_.startsWith("T") && _.contains("->") => true): "(_) -> null"; - case (_.contains("->") => true): - var commas = valueType.split("->")[0].split(",").length; - '(${[for (i in 0...commas) "_"].join(", ")}) -> null'; + case "QueueCell": "new vision.ds.QueueCell(0, null, null)"; default: "null"; } } @@ -173,6 +191,7 @@ typedef TestBase = { className:String, fieldName:String, testGoal:String, - ?parameters:{declarations:String, injection:String}, - ?constructorParameters:{declarations:String, injection:String} + ?parameters:{declarations:String, injection:String, types:String}, + ?constructorParameters:{declarations:String, injection:String, types:String}, + fieldType:String } \ No newline at end of file From a5359c8ecfd1c602fd7ffb3e22165bd3069390b3 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Mon, 9 Jun 2025 23:16:31 +0300 Subject: [PATCH 24/32] Regenerate tests one more time to have a more cohesive structure. Tests done for Array2D and ArrayTools. also made detector more robsut with removed comments, target specific code and fields not of tested class. --- src/vision/ds/Image.hx | 7 +- src/vision/formats/to/ToBytes.hx | 1 + src/vision/tools/ArrayTools.hx | 2 +- tests/config.json | 3 +- tests/generated/src/TestStatus.hx | 40 + tests/generated/src/TestsToRun.hx | 1 + tests/generated/src/tests/Array2DTests.hx | 357 ++-- tests/generated/src/tests/ArrayToolsTests.hx | 354 ++-- .../src/tests/BilateralFilterTests.hx | 24 +- .../src/tests/BilinearInterpolationTests.hx | 48 +- tests/generated/src/tests/ByteArrayTests.hx | 422 ++-- tests/generated/src/tests/CannyTests.hx | 120 +- tests/generated/src/tests/ColorTests.hx | 1342 +++++++----- tests/generated/src/tests/CramerTests.hx | 24 +- .../src/tests/FormatImageExporterTests.hx | 72 +- .../src/tests/FormatImageLoaderTests.hx | 48 +- tests/generated/src/tests/GaussJordanTests.hx | 24 +- tests/generated/src/tests/GaussTests.hx | 216 +- tests/generated/src/tests/HistogramTests.hx | 96 +- .../generated/src/tests/ImageHashingTests.hx | 48 +- tests/generated/src/tests/ImageTests.hx | 1827 +++++++---------- tests/generated/src/tests/ImageToolsTests.hx | 267 +++ tests/generated/src/tests/ImageViewTests.hx | 26 +- .../generated/src/tests/Int16Point2DTests.hx | 144 +- tests/generated/src/tests/IntPoint2DTests.hx | 216 +- tests/generated/src/tests/KMeansTests.hx | 72 +- tests/generated/src/tests/LaplaceTests.hx | 48 +- tests/generated/src/tests/Line2DTests.hx | 168 +- tests/generated/src/tests/MathToolsTests.hx | 1754 +++++++++------- tests/generated/src/tests/Matrix2DTests.hx | 910 ++++---- .../src/tests/PerspectiveWarpTests.hx | 24 +- tests/generated/src/tests/PerwittTests.hx | 48 +- tests/generated/src/tests/Point2DTests.hx | 120 +- tests/generated/src/tests/Point3DTests.hx | 72 +- tests/generated/src/tests/QueueCellTests.hx | 24 +- tests/generated/src/tests/QueueTests.hx | 144 +- tests/generated/src/tests/RadixTests.hx | 72 +- tests/generated/src/tests/Ray2DTests.hx | 168 +- .../generated/src/tests/RobertsCrossTests.hx | 24 +- tests/generated/src/tests/SimpleHoughTests.hx | 48 +- .../src/tests/SimpleLineDetectorTests.hx | 72 +- tests/generated/src/tests/SobelTests.hx | 48 +- .../src/tests/TransformationMatrix2DTests.hx | 264 ++- .../generated/src/tests/UInt16Point2DTests.hx | 144 +- tests/generated/src/tests/VisionTests.hx | 1104 +++++----- .../generated/src/tests/VisionThreadTests.hx | 44 +- tests/generator/Detector.hx | 200 +- tests/generator/Generator.hx | 19 +- tests/generator/Main.hx | 2 + .../templates/InstanceFieldTestTemplate.hx | 24 +- .../templates/InstanceFunctionTestTemplate.hx | 24 +- .../templates/StaticFieldTestTemplate.hx | 24 +- .../templates/StaticFunctionTestTemplate.hx | 24 +- 53 files changed, 6474 insertions(+), 4944 deletions(-) create mode 100644 tests/generated/src/tests/ImageToolsTests.hx diff --git a/src/vision/ds/Image.hx b/src/vision/ds/Image.hx index 717b503b..4b5fe22d 100644 --- a/src/vision/ds/Image.hx +++ b/src/vision/ds/Image.hx @@ -3,10 +3,13 @@ package vision.ds; import vision.formats.ImageIO; import vision.ds.ByteArray; import vision.exceptions.Unimplemented; -import vision.algorithms.BilinearInterpolation; +import vision.algorithms.BilinearInterpolation as Bilinear; // Avoid naming collisions with ImageResizeAlgorithm import haxe.ds.List; import haxe.Int64; import vision.ds.Color; +import vision.ds.Rectangle; +import vision.ds.ImageView; +import vision.ds.ImageResizeAlgorithm; import vision.exceptions.OutOfBounds; import vision.tools.ImageTools; using vision.tools.MathTools; @@ -1111,7 +1114,7 @@ abstract Image(ByteArray) { algorithm = ImageTools.defaultResizeAlgorithm; switch algorithm { case BilinearInterpolation: - this = cast BilinearInterpolation.interpolate(cast this, newWidth, newHeight); + this = cast Bilinear.interpolate(cast this, newWidth, newHeight); case BicubicInterpolation: throw new Unimplemented("Bicubic Interpolation"); case NearestNeighbor: diff --git a/src/vision/formats/to/ToBytes.hx b/src/vision/formats/to/ToBytes.hx index 0e22cf4c..64b48c84 100644 --- a/src/vision/formats/to/ToBytes.hx +++ b/src/vision/formats/to/ToBytes.hx @@ -2,6 +2,7 @@ package vision.formats.to; import vision.ds.ByteArray; import vision.ds.Image; +import vision.exceptions.LibraryRequired; /** A class for saving images to bytes diff --git a/src/vision/tools/ArrayTools.hx b/src/vision/tools/ArrayTools.hx index cdc5ff17..478d1027 100644 --- a/src/vision/tools/ArrayTools.hx +++ b/src/vision/tools/ArrayTools.hx @@ -169,7 +169,7 @@ class ArrayTools { return s[floor(values.length / 2)]; } - public static function distanceTo(array:Array, to:Array, distanceFunction:(T, T) -> Float) { + public static function distanceTo(array:Array, to:Array, distanceFunction:(T, T) -> Float):Float { var sum = 0.; for (i in 0...array.length - 1) { sum += distanceFunction(array[i], array[i + 1]); diff --git a/tests/config.json b/tests/config.json index 06d23c5e..8155b91d 100644 --- a/tests/config.json +++ b/tests/config.json @@ -5,8 +5,7 @@ "exclude": [ "exceptions/", "Array2DMacro.hx", - "FrameworkImageIO.hx", - "ImageTools.hx" + "FrameworkImageIO.hx" ], "destination": "./generated/src/tests", "testsToRunFile": "./generated/src/TestsToRun.hx" diff --git a/tests/generated/src/TestStatus.hx b/tests/generated/src/TestStatus.hx index c84e3f2b..e4419e4b 100644 --- a/tests/generated/src/TestStatus.hx +++ b/tests/generated/src/TestStatus.hx @@ -1,9 +1,49 @@ package; +import vision.exceptions.Unimplemented; + enum abstract TestStatus(String) { var Success; var Failure; var Skipped; var Unimplemented; + + overload extern public static inline function of(condition:Bool):TestStatus { + return condition ? Success : Failure; + } + + overload extern public static inline function of(item:Dynamic, equals:Dynamic):TestStatus { + function deepEquals (lhs:Dynamic, rhs:Dynamic) { + if (lhs is Array && rhs is Array) { + var lhsIterator = lhs.iterator(); + var rhsIterator = rhs.iterator(); + while (lhsIterator.hasNext() && rhsIterator.hasNext()) { + if (!deepEquals(lhsIterator.next(), rhsIterator.next())) { + return false; + } + } + return !lhsIterator.hasNext() && !rhsIterator.hasNext(); + } else { + return lhs == rhs; + } + } + + return deepEquals(item, equals) ? Success : Failure; + } + + public static function multiple(...results:TestStatus) { + var items = results.toArray(); + var result:TestStatus = items[0]; + for (i in 1...items.length) { + result = switch (items[i]) { + case Failure: Failure; + case Unimplemented if (result != Failure): Unimplemented; + case Success if (![Failure, Unimplemented].contains(result)): Success; + case Skipped if (result == Success): Success; + default: result; + } + } + return result; + } } \ No newline at end of file diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index 2b1bdae9..31ea86a0 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -46,6 +46,7 @@ final tests:Array> = [ FormatImageLoaderTests, VisionThreadTests, ArrayToolsTests, + ImageToolsTests, MathToolsTests, VisionTests ]; \ No newline at end of file diff --git a/tests/generated/src/tests/Array2DTests.hx b/tests/generated/src/tests/Array2DTests.hx index 47a6cc45..bb5eb43c 100644 --- a/tests/generated/src/tests/Array2DTests.hx +++ b/tests/generated/src/tests/Array2DTests.hx @@ -1,5 +1,6 @@ package tests; +import vision.ds.IntPoint2D; import TestResult; import TestStatus; @@ -9,253 +10,333 @@ import haxe.iterators.ArrayIterator; @:access(vision.ds.Array2D) class Array2DTests { public static function vision_ds_Array2D__length__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; + var width = 5; + var height = 6; var fillWith = 0; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.length; + var result = object.length; + + return { + testName: "vision.ds.Array2D#length", + returned: result, + expected: 30, + status: TestStatus.of(result == 30) + } } catch (e) { - - } - - return { - testName: "vision.ds.Array2D#length", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#length", + returned: e, + expected: 30, + status: Failure + } } } public static function vision_ds_Array2D__get_Int_Int_T__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 3; + var height = 3; + var fillWith = 3; - var x = 0; + var x = 1; var y = 0; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.get(x, y); - } catch (e) { + var result = object.get(x, y); - } - - return { - testName: "vision.ds.Array2D#get", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#get", + returned: result, + expected: 3, + status: TestStatus.of(result == 3) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#get", + returned: e, + expected: 3, + status: Failure + } } } public static function vision_ds_Array2D__set__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; + var width = 1; + var height = 2; var fillWith = 0; var x = 0; var y = 0; - var val = 0; + var val = 6; var object = new vision.ds.Array2D(width, height, fillWith); object.set(x, y, val); - } catch (e) { - } + if (object.get(x, y) != val) throw 'Array2D#set failed - expected $val at ($x, $y), got ${object.get(x, y)}'; - return { - testName: "vision.ds.Array2D#set", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#set", + returned: null, + expected: null, + status: Success + } + } catch (e) { + return { + testName: "vision.ds.Array2D#set", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Array2D__setMultiple__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; + var width = 2; + var height = 2; var fillWith = 0; - var points = []; - var val = 0; + var points:Array = [{x: 0, y: 1}, {x: 1, y: 0}]; + var val = 6; var object = new vision.ds.Array2D(width, height, fillWith); object.setMultiple(points, val); - } catch (e) { - - } - return { - testName: "vision.ds.Array2D#setMultiple", - returned: result, - expected: null, - status: Unimplemented + for (index in points) if (object.get(index.x, index.y) != val) throw 'Array2D#setMultiple failed - expected $val at (${index.x}, ${index.y}), got ${object.get(index.x, index.y)}'; + + return { + testName: "vision.ds.Array2D#setMultiple", + returned: null, + expected: null, + status: Success + } + } catch (e) { + return { + testName: "vision.ds.Array2D#setMultiple", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Array2D__row_Int_ArrayT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 4; + var height = 4; + var fillWith = 3; var y = 0; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.row(y); - } catch (e) { - } + object.set(0, y, 1); + object.set(1, y, 2); + object.set(2, y, 3); + object.set(3, y, 4); - return { - testName: "vision.ds.Array2D#row", - returned: result, - expected: null, - status: Unimplemented + var result = object.row(y); + + return { + testName: "vision.ds.Array2D#row", + returned: result, + expected: [1, 2, 3, 4], + status: TestStatus.of(result, [1, 2, 3, 4]) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#row", + returned: e, + expected: [1, 2, 3, 4], + status: Failure + } } } public static function vision_ds_Array2D__column_Int_ArrayT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 4; + var height = 4; + var fillWith = 2; var x = 0; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.column(x); - } catch (e) { - } + object.set(x, 0, 1); + object.set(x, 1, 2); + object.set(x, 2, 3); + object.set(x, 3, 4); - return { - testName: "vision.ds.Array2D#column", - returned: result, - expected: null, - status: Unimplemented + var result = object.column(x); + + return { + testName: "vision.ds.Array2D#column", + returned: result, + expected: [1, 2, 3, 4], + status: TestStatus.of(result, [1, 2, 3, 4]) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#column", + returned: e, + expected: [1, 2, 3, 4], + status: Failure + } } } public static function vision_ds_Array2D__iterator__ArrayIteratorT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 2; + var height = 2; + var fillWith = 1; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.iterator(); - } catch (e) { - } + object.set(0, 1, 2); + object.set(1, 0, 3); + object.set(1, 1, 4); - return { - testName: "vision.ds.Array2D#iterator", - returned: result, - expected: null, - status: Unimplemented + var result = object.iterator(); + + for (i in 1...5) { + var value = result.next(); + if (value != i) throw 'Array2D#iterator failed - expected $i, got $value'; + } + + return { + testName: "vision.ds.Array2D#iterator", + returned: result, + expected: [1, 2, 3, 4].iterator(), + status: Success + } + } catch (e) { + return { + testName: "vision.ds.Array2D#iterator", + returned: e, + expected: [1, 2, 3, 4].iterator(), + status: Failure + } } } public static function vision_ds_Array2D__fill_T_Array2DT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; + var width = 5; + var height = 5; var fillWith = 0; - var value = 0; + var value = 5; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.fill(value); - } catch (e) { + var result = object.fill(value); - } - - return { - testName: "vision.ds.Array2D#fill", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#fill", + returned: result, + expected: new Array2D(5, 5, 5), + status: TestStatus.of(object.inner, new Array2D(5, 5, 5).inner) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#fill", + returned: e, + expected: new Array2D(5, 5, 5), + status: Failure + } } } public static function vision_ds_Array2D__clone__Array2DT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 3; + var height = 3; + var fillWith = 3; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.clone(); - } catch (e) { + var result = object.clone(); - } - - return { - testName: "vision.ds.Array2D#clone", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#clone", + returned: result, + expected: new Array2D(3, 3, 3), + status: TestStatus.of(object.inner, new Array2D(width, height, fillWith).inner) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#clone", + returned: e, + expected: new Array2D(3, 3, 3), + status: Failure + } } } public static function vision_ds_Array2D__toString__String__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 6; + var height = 6; + var fillWith = 6; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Array2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#toString", + returned: result, + expected: "\n[[6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6]]", + status: TestStatus.of(result == "\n[[6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6]]") + } + } catch (e) { + return { + testName: "vision.ds.Array2D#toString", + returned: e, + expected: "\n[[6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6],\n [6, 6, 6, 6, 6, 6]]", + status: Failure + } } } public static function vision_ds_Array2D__to2DArray__ArrayArrayT__ShouldWork():TestResult { - var result = null; try { - var width = 0; - var height = 0; - var fillWith = 0; + var width = 6; + var height = 6; + var fillWith = 6; var object = new vision.ds.Array2D(width, height, fillWith); - result = object.to2DArray(); - } catch (e) { + var result = object.to2DArray(); - } - - return { - testName: "vision.ds.Array2D#to2DArray", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Array2D#to2DArray", + returned: result, + expected: [[6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6]], + status: TestStatus.of(result, [[6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6]]) + } + } catch (e) { + return { + testName: "vision.ds.Array2D#to2DArray", + returned: e, + expected: [[6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6], + [6, 6, 6, 6, 6, 6]], + status: Failure + } } } diff --git a/tests/generated/src/tests/ArrayToolsTests.hx b/tests/generated/src/tests/ArrayToolsTests.hx index d895c46b..7ac13548 100644 --- a/tests/generated/src/tests/ArrayToolsTests.hx +++ b/tests/generated/src/tests/ArrayToolsTests.hx @@ -13,243 +13,297 @@ import vision.tools.MathTools.*; @:access(vision.tools.ArrayTools) class ArrayToolsTests { public static function vision_tools_ArrayTools__flatten_Array_ArrayT__ShouldWork():TestResult { - var result = null; try { - var array = []; + var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; - result = vision.tools.ArrayTools.flatten(array); - } catch (e) { - - } + var result = vision.tools.ArrayTools.flatten(array); - return { - testName: "vision.tools.ArrayTools.flatten", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.flatten", + returned: result, + expected: [1, 2, 3, 4, 5, 6, 7, 8, 9], + status: TestStatus.of(result, [1, 2, 3, 4, 5, 6, 7, 8, 9]) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.flatten", + returned: e, + expected: [1, 2, 3, 4, 5, 6, 7, 8, 9], + status: Failure + } } } public static function vision_tools_ArrayTools__raise_ArrayT_Int_ArrayArrayT__ShouldWork():TestResult { - var result = null; try { - var array = []; - var delimiter = 0; + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + var delimiter = 4; - result = vision.tools.ArrayTools.raise(array, delimiter); - } catch (e) { - - } + var result = vision.tools.ArrayTools.raise(array, delimiter); - return { - testName: "vision.tools.ArrayTools.raise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.raise", + returned: result, + expected: [[1, 2, 3, 4], [5, 6, 7, 8], [9]], + status: TestStatus.of(result, [[1, 2, 3, 4], [5, 6, 7, 8], [9]]) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.raise", + returned: e, + expected: [[1, 2, 3, 4], [5, 6, 7, 8], [9]], + status: Failure + } } } public static function vision_tools_ArrayTools__raise_ArrayT_Bool_TBool_ArrayArrayT__ShouldWork():TestResult { - var result = null; try { - var array = []; - var predicateOpensArray = false; - var predicate = (_) -> null; + var array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + var predicate = (number) -> number % 3 == 0; - result = vision.tools.ArrayTools.raise(array, predicateOpensArray, predicate); + var result1 = vision.tools.ArrayTools.raise(array, false, predicate); + var result2 = vision.tools.ArrayTools.raise(array, true, predicate); + return { + testName: "vision.tools.ArrayTools.raise", + returned: '${result1}, then: ${result2}', + expected: '[[1, 2, 3], [4, 5, 6], [7, 8, 9]], then: [[1, 2], [3, 4, 5], [6, 7, 8], [9]]', + status: TestStatus.multiple( + TestStatus.of(result1, [[1, 2, 3], [4, 5, 6], [7, 8, 9]]), + TestStatus.of(result2, [[1, 2], [3, 4, 5], [6, 7, 8], [9]]) + ) + } } catch (e) { - - } - - return { - testName: "vision.tools.ArrayTools.raise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.raise", + returned: e, + expected: '[[1, 2, 3], [4, 5, 6], [7, 8, 9]], then: [[1, 2], [3, 4, 5], [6, 7, 8], [9]]', + status: Failure + } } } public static function vision_tools_ArrayTools__min_ArrayInt64_Int64__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values:Array = [Int64.make(123, 1231), Int64.make(953882, 93241), Int64.make(0, 1231), Int64.make(1, 9876812)]; - result = vision.tools.ArrayTools.min(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.min(values); - return { - testName: "vision.tools.ArrayTools.min", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.min", + returned: result, + expected: Int64.make(0, 1231), + status: TestStatus.of(result == Int64.make(0, 1231)) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.min", + returned: e, + expected: Int64.make(0, 1231), + status: Failure + } } } public static function vision_tools_ArrayTools__min_ArrayT_TFloat_T__ShouldWork():TestResult { - var result = null; try { - var values = []; - var valueFunction = (_) -> null; + var values = ["hey", "whats", "up", "fellas?"]; + var valueFunction = (string) -> string.length; - result = vision.tools.ArrayTools.min(values, valueFunction); - } catch (e) { - - } + var result = vision.tools.ArrayTools.min(values, valueFunction); - return { - testName: "vision.tools.ArrayTools.min", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.min", + returned: result, + expected: "up", + status: TestStatus.of(result == "up") + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.min", + returned: e, + expected: "up", + status: Failure + } } } public static function vision_tools_ArrayTools__max_ArrayInt64_Int64__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values = [Int64.make(123, 1231), Int64.make(953882, 93241), Int64.make(0, 1231), Int64.make(1, 9876812)]; - result = vision.tools.ArrayTools.max(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.max(values); - return { - testName: "vision.tools.ArrayTools.max", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.max", + returned: result, + expected: Int64.make(953882, 93241), + status: TestStatus.of(result == Int64.make(953882, 93241)) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.max", + returned: e, + expected: Int64.make(953882, 93241), + status: Failure + } } } public static function vision_tools_ArrayTools__max_ArrayT_TFloat_T__ShouldWork():TestResult { - var result = null; try { - var values = []; - var valueFunction = (_) -> null; + var values = ["hey", "whats", "up", "fellas?"]; + var valueFunction = (string) -> string.length; - result = vision.tools.ArrayTools.max(values, valueFunction); - } catch (e) { - - } + var result = vision.tools.ArrayTools.max(values, valueFunction); - return { - testName: "vision.tools.ArrayTools.max", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.max", + returned: result, + expected: "fellas?", + status: TestStatus.of(result == "fellas?") + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.max", + returned: e, + expected: "fellas?", + status: Failure + } } } public static function vision_tools_ArrayTools__average_ArrayInt64_Float__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values = [Int64.make(123, 1231), Int64.make(953882, 93241), Int64.make(0, 1231), Int64.make(1, 9876812)]; - result = vision.tools.ArrayTools.average(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.average(values); - return { - testName: "vision.tools.ArrayTools.average", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.average", + returned: result, + expected: 238500, + status: TestStatus.of(result == 238500) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.average", + returned: e, + expected: 238500, + status: Failure + } } } public static function vision_tools_ArrayTools__median_ArrayInt_Int__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values = [1, 1, 2, 2, 3, 3, 3, 3, 3]; - result = vision.tools.ArrayTools.median(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.median(values); - return { - testName: "vision.tools.ArrayTools.median", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: 3, + status: TestStatus.of(result == 3) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.median", + returned: e, + expected: 3, + status: Failure + } } } public static function vision_tools_ArrayTools__median_ArrayInt64_Int64__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values = [Int64.make(0, 1), Int64.make(0, 1), Int64.make(0, 2), Int64.make(0, 2), Int64.make(0, 3), Int64.make(0, 3), Int64.make(0, 3), Int64.make(0, 3), Int64.make(0, 3)]; - result = vision.tools.ArrayTools.median(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.median(values); - return { - testName: "vision.tools.ArrayTools.median", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: Int64.make(0, 3), + status: TestStatus.of(result == Int64.make(0, 3)) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.median", + returned: e, + expected: Int64.make(0, 3), + status: Failure + } } } public static function vision_tools_ArrayTools__median_ArrayFloat_Float__ShouldWork():TestResult { - var result = null; try { - var values = []; + var values = [0.1, 0.1, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.3]; - result = vision.tools.ArrayTools.median(values); - } catch (e) { - - } + var result = vision.tools.ArrayTools.median(values); - return { - testName: "vision.tools.ArrayTools.median", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.median", + returned: result, + expected: 0.3, + status: TestStatus.of(result == 0.3) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.median", + returned: e, + expected: 0.3, + status: Failure + } } } public static function vision_tools_ArrayTools__distanceTo__ShouldWork():TestResult { - var result = null; try { - var array = []; - var to = []; - var distanceFunction = (_, _) -> null; + var array = ["hey", "whats", "up", "fellas?"]; + var to = ["tung", "tung", "tung", "sahur"]; + var distanceFunction = (str1, str2) -> str2.length - str1.length; - vision.tools.ArrayTools.distanceTo(array, to, distanceFunction); - } catch (e) { - - } + var result = vision.tools.ArrayTools.distanceTo(array, to, distanceFunction); - return { - testName: "vision.tools.ArrayTools.distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.distanceTo", + returned: result, + expected: 0, + status: TestStatus.of(result == 0) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.distanceTo", + returned: e, + expected: 0, + status: Failure + } } } public static function vision_tools_ArrayTools__distinct_ArrayT_ArrayT__ShouldWork():TestResult { - var result = null; try { - var array = []; + var array = [0, 0, 0, 1, 1, 1, 2, 2, 2]; - result = vision.tools.ArrayTools.distinct(array); - } catch (e) { - - } + var result = vision.tools.ArrayTools.distinct(array); - return { - testName: "vision.tools.ArrayTools.distinct", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.ArrayTools.distinct", + returned: result, + expected: [0, 1, 2], + status: TestStatus.of(result, [0, 1, 2]) + } + } catch (e) { + return { + testName: "vision.tools.ArrayTools.distinct", + returned: e, + expected: [0, 1, 2], + status: Failure + } } } diff --git a/tests/generated/src/tests/BilateralFilterTests.hx b/tests/generated/src/tests/BilateralFilterTests.hx index 5c0bff08..36e7f9aa 100644 --- a/tests/generated/src/tests/BilateralFilterTests.hx +++ b/tests/generated/src/tests/BilateralFilterTests.hx @@ -12,22 +12,26 @@ import vision.ds.Image; @:access(vision.algorithms.BilateralFilter) class BilateralFilterTests { public static function vision_algorithms_BilateralFilter__filter_Image_Float_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var distanceSigma = 0.0; var intensitySigma = 0.0; - result = vision.algorithms.BilateralFilter.filter(image, distanceSigma, intensitySigma); - } catch (e) { - - } + var result = vision.algorithms.BilateralFilter.filter(image, distanceSigma, intensitySigma); - return { - testName: "vision.algorithms.BilateralFilter.filter", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.BilateralFilter.filter", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.BilateralFilter.filter", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/BilinearInterpolationTests.hx b/tests/generated/src/tests/BilinearInterpolationTests.hx index 7efeec05..3c0d1124 100644 --- a/tests/generated/src/tests/BilinearInterpolationTests.hx +++ b/tests/generated/src/tests/BilinearInterpolationTests.hx @@ -11,27 +11,30 @@ import vision.tools.MathTools.*; @:access(vision.algorithms.BilinearInterpolation) class BilinearInterpolationTests { public static function vision_algorithms_BilinearInterpolation__interpolate_Image_Int_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var width = 0; var height = 0; - result = vision.algorithms.BilinearInterpolation.interpolate(image, width, height); - } catch (e) { - - } + var result = vision.algorithms.BilinearInterpolation.interpolate(image, width, height); - return { - testName: "vision.algorithms.BilinearInterpolation.interpolate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.BilinearInterpolation.interpolate", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.BilinearInterpolation.interpolate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_BilinearInterpolation__interpolateMissingPixels_Image_Int_Int_Int_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var kernelRadiusX = 0; @@ -39,16 +42,21 @@ class BilinearInterpolationTests { var minX = 0; var minY = 0; - result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels(image, kernelRadiusX, kernelRadiusY, minX, minY); - } catch (e) { - - } + var result = vision.algorithms.BilinearInterpolation.interpolateMissingPixels(image, kernelRadiusX, kernelRadiusY, minX, minY); - return { - testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.BilinearInterpolation.interpolateMissingPixels", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx index c221e87c..75894802 100644 --- a/tests/generated/src/tests/ByteArrayTests.hx +++ b/tests/generated/src/tests/ByteArrayTests.hx @@ -12,116 +12,139 @@ import haxe.io.Bytes; @:access(vision.ds.ByteArray) class ByteArrayTests { public static function vision_ds_ByteArray__from_Int_ByteArray__ShouldWork():TestResult { - var result = null; try { var value = 0; - result = vision.ds.ByteArray.from(value); + var result = vision.ds.ByteArray.from(value); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__from_Int64_ByteArray__ShouldWork():TestResult { - var result = null; try { var value:Int64 = null; - result = vision.ds.ByteArray.from(value); + var result = vision.ds.ByteArray.from(value); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__from_Float_ByteArray__ShouldWork():TestResult { - var result = null; try { var value = 0.0; - result = vision.ds.ByteArray.from(value); + var result = vision.ds.ByteArray.from(value); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__from_Bool_ByteArray__ShouldWork():TestResult { - var result = null; try { var value = false; - result = vision.ds.ByteArray.from(value); + var result = vision.ds.ByteArray.from(value); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__from_String_haxeioEncoding_ByteArray__ShouldWork():TestResult { - var result = null; try { var value = ""; var encoding:haxe.io.Encoding = null; - result = vision.ds.ByteArray.from(value, encoding); + var result = vision.ds.ByteArray.from(value, encoding); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__from_Dynamic_ByteArray__ShouldWork():TestResult { - var result = null; try { var value:Dynamic = null; - result = vision.ds.ByteArray.from(value); + var result = vision.ds.ByteArray.from(value); + + return { + testName: "vision.ds.ByteArray.from", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.ByteArray.from", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray.from", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__setUInt8__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -131,20 +154,24 @@ class ByteArrayTests { var object = new vision.ds.ByteArray(length, fillWith); object.setUInt8(pos, v); - } catch (e) { - } - - return { - testName: "vision.ds.ByteArray#setUInt8", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#setUInt8", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#setUInt8", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__getUInt8_Int_Int__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -152,21 +179,25 @@ class ByteArrayTests { var pos = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.getUInt8(pos); - } catch (e) { + var result = object.getUInt8(pos); - } - - return { - testName: "vision.ds.ByteArray#getUInt8", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#getUInt8", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#getUInt8", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__setUInt32__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -176,20 +207,24 @@ class ByteArrayTests { var object = new vision.ds.ByteArray(length, fillWith); object.setUInt32(pos, value); - } catch (e) { - } - - return { - testName: "vision.ds.ByteArray#setUInt32", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#setUInt32", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#setUInt32", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__getUInt32_Int_UInt__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -197,21 +232,25 @@ class ByteArrayTests { var pos = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.getUInt32(pos); - } catch (e) { + var result = object.getUInt32(pos); - } - - return { - testName: "vision.ds.ByteArray#getUInt32", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#getUInt32", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#getUInt32", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__setInt8__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -221,20 +260,24 @@ class ByteArrayTests { var object = new vision.ds.ByteArray(length, fillWith); object.setInt8(pos, v); - } catch (e) { - } - - return { - testName: "vision.ds.ByteArray#setInt8", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#setInt8", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#setInt8", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__getInt8_Int_Int__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -242,21 +285,25 @@ class ByteArrayTests { var pos = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.getInt8(pos); - } catch (e) { + var result = object.getInt8(pos); - } - - return { - testName: "vision.ds.ByteArray#getInt8", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#getInt8", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#getInt8", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__setBytes__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -266,20 +313,24 @@ class ByteArrayTests { var object = new vision.ds.ByteArray(length, fillWith); object.setBytes(pos, array); - } catch (e) { - } - - return { - testName: "vision.ds.ByteArray#setBytes", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#setBytes", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#setBytes", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__getBytes_Int_Int_ByteArray__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -288,21 +339,25 @@ class ByteArrayTests { var length = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.getBytes(pos, length); - } catch (e) { + var result = object.getBytes(pos, length); - } - - return { - testName: "vision.ds.ByteArray#getBytes", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#getBytes", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#getBytes", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__resize__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -311,20 +366,24 @@ class ByteArrayTests { var object = new vision.ds.ByteArray(length, fillWith); object.resize(length); - } catch (e) { - } - - return { - testName: "vision.ds.ByteArray#resize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#resize", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#resize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__concat_ByteArray_ByteArray__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; @@ -332,58 +391,71 @@ class ByteArrayTests { var array = vision.ds.ByteArray.from(0); var object = new vision.ds.ByteArray(length, fillWith); - result = object.concat(array); - } catch (e) { + var result = object.concat(array); - } - - return { - testName: "vision.ds.ByteArray#concat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#concat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#concat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__isEmpty__Bool__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.isEmpty(); - } catch (e) { + var result = object.isEmpty(); - } - - return { - testName: "vision.ds.ByteArray#isEmpty", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#isEmpty", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#isEmpty", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_ByteArray__toArray__ArrayInt__ShouldWork():TestResult { - var result = null; try { var length = 0; var fillWith = 0; var object = new vision.ds.ByteArray(length, fillWith); - result = object.toArray(); - } catch (e) { + var result = object.toArray(); - } - - return { - testName: "vision.ds.ByteArray#toArray", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ByteArray#toArray", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#toArray", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/CannyTests.hx b/tests/generated/src/tests/CannyTests.hx index 689c39ba..66bed2ba 100644 --- a/tests/generated/src/tests/CannyTests.hx +++ b/tests/generated/src/tests/CannyTests.hx @@ -11,96 +11,116 @@ import vision.ds.canny.CannyObject; @:access(vision.algorithms.Canny) class CannyTests { public static function vision_algorithms_Canny__grayscale_CannyObject_CannyObject__ShouldWork():TestResult { - var result = null; try { var image:CannyObject = null; - result = vision.algorithms.Canny.grayscale(image); - } catch (e) { - - } + var result = vision.algorithms.Canny.grayscale(image); - return { - testName: "vision.algorithms.Canny.grayscale", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Canny.grayscale", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Canny.grayscale", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Canny__applyGaussian_CannyObject_Int_Float_CannyObject__ShouldWork():TestResult { - var result = null; try { var image:CannyObject = null; var size = 0; var sigma = 0.0; - result = vision.algorithms.Canny.applyGaussian(image, size, sigma); - } catch (e) { - - } + var result = vision.algorithms.Canny.applyGaussian(image, size, sigma); - return { - testName: "vision.algorithms.Canny.applyGaussian", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Canny.applyGaussian", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Canny.applyGaussian", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Canny__applySobelFilters_CannyObject_CannyObject__ShouldWork():TestResult { - var result = null; try { var image:CannyObject = null; - result = vision.algorithms.Canny.applySobelFilters(image); - } catch (e) { - - } + var result = vision.algorithms.Canny.applySobelFilters(image); - return { - testName: "vision.algorithms.Canny.applySobelFilters", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Canny.applySobelFilters", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Canny.applySobelFilters", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Canny__nonMaxSuppression_CannyObject_CannyObject__ShouldWork():TestResult { - var result = null; try { var image:CannyObject = null; - result = vision.algorithms.Canny.nonMaxSuppression(image); - } catch (e) { - - } + var result = vision.algorithms.Canny.nonMaxSuppression(image); - return { - testName: "vision.algorithms.Canny.nonMaxSuppression", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Canny.nonMaxSuppression", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Canny.nonMaxSuppression", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Canny__applyHysteresis_CannyObject_Float_Float_CannyObject__ShouldWork():TestResult { - var result = null; try { var image:CannyObject = null; var highThreshold = 0.0; var lowThreshold = 0.0; - result = vision.algorithms.Canny.applyHysteresis(image, highThreshold, lowThreshold); - } catch (e) { - - } + var result = vision.algorithms.Canny.applyHysteresis(image, highThreshold, lowThreshold); - return { - testName: "vision.algorithms.Canny.applyHysteresis", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Canny.applyHysteresis", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Canny.applyHysteresis", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index a09a7643..b5aa53f9 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -10,426 +10,513 @@ import vision.tools.MathTools; @:access(vision.ds.Color) class ColorTests { public static function vision_ds_Color__red__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.red; + var result = object.red; + + return { + testName: "vision.ds.Color#red", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#red", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#red", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__blue__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.blue; + var result = object.blue; + + return { + testName: "vision.ds.Color#blue", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#blue", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#blue", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__green__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.green; + var result = object.green; + + return { + testName: "vision.ds.Color#green", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#green", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#green", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__alpha__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.alpha; + var result = object.alpha; + + return { + testName: "vision.ds.Color#alpha", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#alpha", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#alpha", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__redFloat__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.redFloat; + var result = object.redFloat; + + return { + testName: "vision.ds.Color#redFloat", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#redFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#redFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__blueFloat__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.blueFloat; + var result = object.blueFloat; + + return { + testName: "vision.ds.Color#blueFloat", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#blueFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#blueFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__greenFloat__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.greenFloat; + var result = object.greenFloat; + + return { + testName: "vision.ds.Color#greenFloat", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#greenFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#greenFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__alphaFloat__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.alphaFloat; + var result = object.alphaFloat; + + return { + testName: "vision.ds.Color#alphaFloat", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#alphaFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#alphaFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__cyan__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.cyan; + var result = object.cyan; + + return { + testName: "vision.ds.Color#cyan", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#cyan", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#cyan", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__magenta__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.magenta; + var result = object.magenta; + + return { + testName: "vision.ds.Color#magenta", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#magenta", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#magenta", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__yellow__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.yellow; + var result = object.yellow; + + return { + testName: "vision.ds.Color#yellow", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#yellow", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#yellow", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__black__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.black; + var result = object.black; + + return { + testName: "vision.ds.Color#black", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#black", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#black", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__rgb__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.rgb; + var result = object.rgb; + + return { + testName: "vision.ds.Color#rgb", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#rgb", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#rgb", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__hue__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.hue; + var result = object.hue; + + return { + testName: "vision.ds.Color#hue", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#hue", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#hue", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__saturation__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.saturation; + var result = object.saturation; + + return { + testName: "vision.ds.Color#saturation", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#saturation", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#saturation", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__brightness__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.brightness; + var result = object.brightness; + + return { + testName: "vision.ds.Color#brightness", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#brightness", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#brightness", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__lightness__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.lightness; + var result = object.lightness; + + return { + testName: "vision.ds.Color#lightness", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Color#lightness", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#lightness", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromInt_Int_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; - result = vision.ds.Color.fromInt(value); - } catch (e) { - - } + var result = vision.ds.Color.fromInt(value); - return { - testName: "vision.ds.Color.fromInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromInt", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromRGBA_Int_Int_Int_Int_Color__ShouldWork():TestResult { - var result = null; try { var Red = 0; var Green = 0; var Blue = 0; var Alpha = 0; - result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); - } catch (e) { - - } + var result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); - return { - testName: "vision.ds.Color.fromRGBA", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromRGBA", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromRGBA", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__from8Bit_Int_Color__ShouldWork():TestResult { - var result = null; try { var Value = 0; - result = vision.ds.Color.from8Bit(Value); - } catch (e) { - - } + var result = vision.ds.Color.from8Bit(Value); - return { - testName: "vision.ds.Color.from8Bit", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.from8Bit", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.from8Bit", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromFloat_Float_Color__ShouldWork():TestResult { - var result = null; try { var Value = 0.0; - result = vision.ds.Color.fromFloat(Value); - } catch (e) { - - } + var result = vision.ds.Color.fromFloat(Value); - return { - testName: "vision.ds.Color.fromFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromRGBAFloat_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var Red = 0.0; var Green = 0.0; var Blue = 0.0; var Alpha = 0.0; - result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); - } catch (e) { - - } + var result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); - return { - testName: "vision.ds.Color.fromRGBAFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromRGBAFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromRGBAFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromCMYK_Float_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var Cyan = 0.0; var Magenta = 0.0; @@ -437,396 +524,476 @@ class ColorTests { var Black = 0.0; var Alpha = 0.0; - result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); - } catch (e) { - - } + var result = vision.ds.Color.fromCMYK(Cyan, Magenta, Yellow, Black, Alpha); - return { - testName: "vision.ds.Color.fromCMYK", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromCMYK", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromCMYK", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromHSB_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var Hue = 0.0; var Saturation = 0.0; var Brightness = 0.0; var Alpha = 0.0; - result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); - } catch (e) { - - } + var result = vision.ds.Color.fromHSB(Hue, Saturation, Brightness, Alpha); - return { - testName: "vision.ds.Color.fromHSB", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromHSB", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromHSB", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromHSL_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var Hue = 0.0; var Saturation = 0.0; var Lightness = 0.0; var Alpha = 0.0; - result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); - } catch (e) { - - } + var result = vision.ds.Color.fromHSL(Hue, Saturation, Lightness, Alpha); - return { - testName: "vision.ds.Color.fromHSL", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromHSL", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromHSL", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__fromString_String_NullColor__ShouldWork():TestResult { - var result = null; try { var str = ""; - result = vision.ds.Color.fromString(str); - } catch (e) { - - } + var result = vision.ds.Color.fromString(str); - return { - testName: "vision.ds.Color.fromString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.fromString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.fromString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getHSBColorWheel_Int_ArrayColor__ShouldWork():TestResult { - var result = null; try { var Alpha = 0; - result = vision.ds.Color.getHSBColorWheel(Alpha); - } catch (e) { - - } + var result = vision.ds.Color.getHSBColorWheel(Alpha); - return { - testName: "vision.ds.Color.getHSBColorWheel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.getHSBColorWheel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.getHSBColorWheel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__interpolate_Color_Color_Float_Color__ShouldWork():TestResult { - var result = null; try { var Color1:Color = null; var Color2:Color = null; var Factor = 0.0; - result = vision.ds.Color.interpolate(Color1, Color2, Factor); - } catch (e) { - - } + var result = vision.ds.Color.interpolate(Color1, Color2, Factor); - return { - testName: "vision.ds.Color.interpolate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.interpolate", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.interpolate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__gradient_Color_Color_Int_FloatFloat_ArrayColor__ShouldWork():TestResult { - var result = null; try { var Color1:Color = null; var Color2:Color = null; var Steps = 0; var Ease = (_) -> null; - result = vision.ds.Color.gradient(Color1, Color2, Steps, Ease); - } catch (e) { - - } + var result = vision.ds.Color.gradient(Color1, Color2, Steps, Ease); - return { - testName: "vision.ds.Color.gradient", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.gradient", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.gradient", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__makeRandom_Bool_Int_Color__ShouldWork():TestResult { - var result = null; try { var alphaLock = false; var alphaValue = 0; - result = vision.ds.Color.makeRandom(alphaLock, alphaValue); - } catch (e) { - - } + var result = vision.ds.Color.makeRandom(alphaLock, alphaValue); - return { - testName: "vision.ds.Color.makeRandom", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.makeRandom", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.makeRandom", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__multiply_Color_Color_Color__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.multiply(lhs, rhs); - } catch (e) { - - } + var result = vision.ds.Color.multiply(lhs, rhs); - return { - testName: "vision.ds.Color.multiply", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.multiply", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.multiply", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__add_Color_Color_Color__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.add(lhs, rhs); - } catch (e) { - - } + var result = vision.ds.Color.add(lhs, rhs); - return { - testName: "vision.ds.Color.add", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.add", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.add", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__subtract_Color_Color_Color__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.subtract(lhs, rhs); - } catch (e) { - - } + var result = vision.ds.Color.subtract(lhs, rhs); - return { - testName: "vision.ds.Color.subtract", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.subtract", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.subtract", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__divide_Color_Color_Color__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; - result = vision.ds.Color.divide(lhs, rhs); - } catch (e) { - - } + var result = vision.ds.Color.divide(lhs, rhs); - return { - testName: "vision.ds.Color.divide", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.divide", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.divide", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__distanceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; var considerTransparency = false; - result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); - } catch (e) { - - } + var result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); - return { - testName: "vision.ds.Color.distanceBetween", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.distanceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.distanceBetween", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__differenceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { - var result = null; try { var lhs:Color = null; var rhs:Color = null; var considerTransparency = false; - result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); - } catch (e) { - - } + var result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); - return { - testName: "vision.ds.Color.differenceBetween", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.differenceBetween", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.differenceBetween", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getAverage_ArrayColor_Bool_Color__ShouldWork():TestResult { - var result = null; try { var fromColors = []; var considerTransparency = false; - result = vision.ds.Color.getAverage(fromColors, considerTransparency); - } catch (e) { - - } + var result = vision.ds.Color.getAverage(fromColors, considerTransparency); - return { - testName: "vision.ds.Color.getAverage", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color.getAverage", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color.getAverage", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getComplementHarmony__Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.getComplementHarmony(); - } catch (e) { + var result = object.getComplementHarmony(); - } - - return { - testName: "vision.ds.Color#getComplementHarmony", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#getComplementHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#getComplementHarmony", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getAnalogousHarmony_Int_Harmony__ShouldWork():TestResult { - var result = null; try { var value = 0; var Threshold = 0; var object = new vision.ds.Color(value); - result = object.getAnalogousHarmony(Threshold); - } catch (e) { + var result = object.getAnalogousHarmony(Threshold); - } - - return { - testName: "vision.ds.Color#getAnalogousHarmony", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#getAnalogousHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#getAnalogousHarmony", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getSplitComplementHarmony_Int_Harmony__ShouldWork():TestResult { - var result = null; try { var value = 0; var Threshold = 0; var object = new vision.ds.Color(value); - result = object.getSplitComplementHarmony(Threshold); - } catch (e) { + var result = object.getSplitComplementHarmony(Threshold); - } - - return { - testName: "vision.ds.Color#getSplitComplementHarmony", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#getSplitComplementHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#getSplitComplementHarmony", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__getTriadicHarmony__TriadicHarmony__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.getTriadicHarmony(); - } catch (e) { + var result = object.getTriadicHarmony(); - } - - return { - testName: "vision.ds.Color#getTriadicHarmony", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#getTriadicHarmony", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#getTriadicHarmony", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__to24Bit__Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.to24Bit(); - } catch (e) { + var result = object.to24Bit(); - } - - return { - testName: "vision.ds.Color#to24Bit", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#to24Bit", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#to24Bit", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__toHexString_Bool_Bool_String__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -834,103 +1001,123 @@ class ColorTests { var Prefix = false; var object = new vision.ds.Color(value); - result = object.toHexString(Alpha, Prefix); - } catch (e) { + var result = object.toHexString(Alpha, Prefix); - } - - return { - testName: "vision.ds.Color#toHexString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#toHexString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#toHexString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__toWebString__String__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.toWebString(); - } catch (e) { + var result = object.toWebString(); - } - - return { - testName: "vision.ds.Color#toWebString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#toWebString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#toWebString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__darken_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var Factor = 0.0; var object = new vision.ds.Color(value); - result = object.darken(Factor); - } catch (e) { + var result = object.darken(Factor); - } - - return { - testName: "vision.ds.Color#darken", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#darken", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#darken", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__lighten_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var Factor = 0.0; var object = new vision.ds.Color(value); - result = object.lighten(Factor); - } catch (e) { + var result = object.lighten(Factor); - } - - return { - testName: "vision.ds.Color#lighten", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#lighten", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#lighten", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__invert__Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.invert(); - } catch (e) { + var result = object.invert(); - } - - return { - testName: "vision.ds.Color#invert", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#invert", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#invert", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__setRGBA_Int_Int_Int_Int_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -940,21 +1127,25 @@ class ColorTests { var Alpha = 0; var object = new vision.ds.Color(value); - result = object.setRGBA(Red, Green, Blue, Alpha); - } catch (e) { + var result = object.setRGBA(Red, Green, Blue, Alpha); - } - - return { - testName: "vision.ds.Color#setRGBA", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#setRGBA", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#setRGBA", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__setRGBAFloat_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -964,21 +1155,25 @@ class ColorTests { var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.setRGBAFloat(Red, Green, Blue, Alpha); - } catch (e) { + var result = object.setRGBAFloat(Red, Green, Blue, Alpha); - } - - return { - testName: "vision.ds.Color#setRGBAFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#setRGBAFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#setRGBAFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__setCMYK_Float_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -989,21 +1184,25 @@ class ColorTests { var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.setCMYK(Cyan, Magenta, Yellow, Black, Alpha); - } catch (e) { + var result = object.setCMYK(Cyan, Magenta, Yellow, Black, Alpha); - } - - return { - testName: "vision.ds.Color#setCMYK", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#setCMYK", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#setCMYK", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__setHSB_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -1013,21 +1212,25 @@ class ColorTests { var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.setHSB(Hue, Saturation, Brightness, Alpha); - } catch (e) { + var result = object.setHSB(Hue, Saturation, Brightness, Alpha); - } - - return { - testName: "vision.ds.Color#setHSB", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#setHSB", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#setHSB", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__setHSL_Float_Float_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; @@ -1037,98 +1240,119 @@ class ColorTests { var Alpha = 0.0; var object = new vision.ds.Color(value); - result = object.setHSL(Hue, Saturation, Lightness, Alpha); - } catch (e) { + var result = object.setHSL(Hue, Saturation, Lightness, Alpha); - } - - return { - testName: "vision.ds.Color#setHSL", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#setHSL", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#setHSL", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__grayscale_Bool_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var simple = false; var object = new vision.ds.Color(value); - result = object.grayscale(simple); - } catch (e) { + var result = object.grayscale(simple); - } - - return { - testName: "vision.ds.Color#grayscale", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#grayscale", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#grayscale", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__blackOrWhite_Int_Color__ShouldWork():TestResult { - var result = null; try { var value = 0; var threshold = 0; var object = new vision.ds.Color(value); - result = object.blackOrWhite(threshold); - } catch (e) { + var result = object.blackOrWhite(threshold); - } - - return { - testName: "vision.ds.Color#blackOrWhite", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#blackOrWhite", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#blackOrWhite", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__toString__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); object.toString(); - } catch (e) { - } - - return { - testName: "vision.ds.Color#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#toString", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Color__toInt__Int__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Color(value); - result = object.toInt(); - } catch (e) { + var result = object.toInt(); - } - - return { - testName: "vision.ds.Color#toInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Color#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Color#toInt", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/CramerTests.hx b/tests/generated/src/tests/CramerTests.hx index fb632c72..6923e95f 100644 --- a/tests/generated/src/tests/CramerTests.hx +++ b/tests/generated/src/tests/CramerTests.hx @@ -11,21 +11,25 @@ import vision.ds.Matrix2D; @:access(vision.algorithms.Cramer) class CramerTests { public static function vision_algorithms_Cramer__solveVariablesFor_Matrix2D_ArrayFloat_ArrayFloat__ShouldWork():TestResult { - var result = null; try { var coefficients:Matrix2D = null; var solutions = []; - result = vision.algorithms.Cramer.solveVariablesFor(coefficients, solutions); - } catch (e) { - - } + var result = vision.algorithms.Cramer.solveVariablesFor(coefficients, solutions); - return { - testName: "vision.algorithms.Cramer.solveVariablesFor", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Cramer.solveVariablesFor", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Cramer.solveVariablesFor", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/FormatImageExporterTests.hx b/tests/generated/src/tests/FormatImageExporterTests.hx index aa76aa6a..d9e9cf28 100644 --- a/tests/generated/src/tests/FormatImageExporterTests.hx +++ b/tests/generated/src/tests/FormatImageExporterTests.hx @@ -20,56 +20,68 @@ import format.jpg.Data; @:access(vision.formats.__internal.FormatImageExporter) class FormatImageExporterTests { public static function vision_formats___internal_FormatImageExporter__png_Image_ByteArray__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.formats.__internal.FormatImageExporter.png(image); - } catch (e) { - - } + var result = vision.formats.__internal.FormatImageExporter.png(image); - return { - testName: "vision.formats.__internal.FormatImageExporter.png", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.formats.__internal.FormatImageExporter.png", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.formats.__internal.FormatImageExporter.png", + returned: e, + expected: null, + status: Failure + } } } public static function vision_formats___internal_FormatImageExporter__bmp_Image_ByteArray__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.formats.__internal.FormatImageExporter.bmp(image); - } catch (e) { - - } + var result = vision.formats.__internal.FormatImageExporter.bmp(image); - return { - testName: "vision.formats.__internal.FormatImageExporter.bmp", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.formats.__internal.FormatImageExporter.bmp", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.formats.__internal.FormatImageExporter.bmp", + returned: e, + expected: null, + status: Failure + } } } public static function vision_formats___internal_FormatImageExporter__jpeg_Image_ByteArray__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.formats.__internal.FormatImageExporter.jpeg(image); - } catch (e) { - - } + var result = vision.formats.__internal.FormatImageExporter.jpeg(image); - return { - testName: "vision.formats.__internal.FormatImageExporter.jpeg", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.formats.__internal.FormatImageExporter.jpeg", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.formats.__internal.FormatImageExporter.jpeg", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/FormatImageLoaderTests.hx b/tests/generated/src/tests/FormatImageLoaderTests.hx index 00a2d583..6239dee5 100644 --- a/tests/generated/src/tests/FormatImageLoaderTests.hx +++ b/tests/generated/src/tests/FormatImageLoaderTests.hx @@ -16,38 +16,46 @@ import format.bmp.Tools; @:access(vision.formats.__internal.FormatImageLoader) class FormatImageLoaderTests { public static function vision_formats___internal_FormatImageLoader__png_ByteArray_Image__ShouldWork():TestResult { - var result = null; try { var bytes = vision.ds.ByteArray.from(0); - result = vision.formats.__internal.FormatImageLoader.png(bytes); + var result = vision.formats.__internal.FormatImageLoader.png(bytes); + + return { + testName: "vision.formats.__internal.FormatImageLoader.png", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.formats.__internal.FormatImageLoader.png", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.formats.__internal.FormatImageLoader.png", + returned: e, + expected: null, + status: Failure + } } } public static function vision_formats___internal_FormatImageLoader__bmp_ByteArray_Image__ShouldWork():TestResult { - var result = null; try { var bytes = vision.ds.ByteArray.from(0); - result = vision.formats.__internal.FormatImageLoader.bmp(bytes); + var result = vision.formats.__internal.FormatImageLoader.bmp(bytes); + + return { + testName: "vision.formats.__internal.FormatImageLoader.bmp", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.formats.__internal.FormatImageLoader.bmp", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.formats.__internal.FormatImageLoader.bmp", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/GaussJordanTests.hx b/tests/generated/src/tests/GaussJordanTests.hx index 1a94801c..b003d074 100644 --- a/tests/generated/src/tests/GaussJordanTests.hx +++ b/tests/generated/src/tests/GaussJordanTests.hx @@ -9,20 +9,24 @@ import vision.ds.Matrix2D; @:access(vision.algorithms.GaussJordan) class GaussJordanTests { public static function vision_algorithms_GaussJordan__invert_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var matrix:Matrix2D = null; - result = vision.algorithms.GaussJordan.invert(matrix); - } catch (e) { - - } + var result = vision.algorithms.GaussJordan.invert(matrix); - return { - testName: "vision.algorithms.GaussJordan.invert", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.GaussJordan.invert", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.GaussJordan.invert", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/GaussTests.hx b/tests/generated/src/tests/GaussTests.hx index 8b269165..c1e7ef98 100644 --- a/tests/generated/src/tests/GaussTests.hx +++ b/tests/generated/src/tests/GaussTests.hx @@ -12,169 +12,205 @@ import vision.exceptions.InvalidGaussianKernelSize; @:access(vision.algorithms.Gauss) class GaussTests { public static function vision_algorithms_Gauss__create1x1Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { - var result = null; try { var sigma = 0.0; - result = vision.algorithms.Gauss.create1x1Kernel(sigma); + var result = vision.algorithms.Gauss.create1x1Kernel(sigma); + + return { + testName: "vision.algorithms.Gauss.create1x1Kernel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create1x1Kernel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create1x1Kernel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create3x3Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { - var result = null; try { var sigma = 0.0; - result = vision.algorithms.Gauss.create3x3Kernel(sigma); + var result = vision.algorithms.Gauss.create3x3Kernel(sigma); + + return { + testName: "vision.algorithms.Gauss.create3x3Kernel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create3x3Kernel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create3x3Kernel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create5x5Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { - var result = null; try { var sigma = 0.0; - result = vision.algorithms.Gauss.create5x5Kernel(sigma); + var result = vision.algorithms.Gauss.create5x5Kernel(sigma); + + return { + testName: "vision.algorithms.Gauss.create5x5Kernel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create5x5Kernel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create5x5Kernel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create7x7Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { - var result = null; try { var sigma = 0.0; - result = vision.algorithms.Gauss.create7x7Kernel(sigma); + var result = vision.algorithms.Gauss.create7x7Kernel(sigma); + + return { + testName: "vision.algorithms.Gauss.create7x7Kernel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create7x7Kernel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create7x7Kernel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create9x9Kernel_Float_ArrayArrayFloat__ShouldWork():TestResult { - var result = null; try { var sigma = 0.0; - result = vision.algorithms.Gauss.create9x9Kernel(sigma); + var result = vision.algorithms.Gauss.create9x9Kernel(sigma); + + return { + testName: "vision.algorithms.Gauss.create9x9Kernel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create9x9Kernel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create9x9Kernel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__createKernelOfSize_Int_Int_Array2DFloat__ShouldWork():TestResult { - var result = null; try { var size = 0; var sigma = 0; - result = vision.algorithms.Gauss.createKernelOfSize(size, sigma); + var result = vision.algorithms.Gauss.createKernelOfSize(size, sigma); + + return { + testName: "vision.algorithms.Gauss.createKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.createKernelOfSize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.createKernelOfSize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create2DKernelOfSize_Int_Float_Array2DFloat__ShouldWork():TestResult { - var result = null; try { var size = 0; var sigma = 0.0; - result = vision.algorithms.Gauss.create2DKernelOfSize(size, sigma); + var result = vision.algorithms.Gauss.create2DKernelOfSize(size, sigma); + + return { + testName: "vision.algorithms.Gauss.create2DKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create2DKernelOfSize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create2DKernelOfSize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__create1DKernelOfSize_Int_Float_ArrayFloat__ShouldWork():TestResult { - var result = null; try { var size = 0; var sigma = 0.0; - result = vision.algorithms.Gauss.create1DKernelOfSize(size, sigma); + var result = vision.algorithms.Gauss.create1DKernelOfSize(size, sigma); + + return { + testName: "vision.algorithms.Gauss.create1DKernelOfSize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.create1DKernelOfSize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.create1DKernelOfSize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Gauss__fastBlur_Image_Int_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var size = 0; var sigma = 0.0; - result = vision.algorithms.Gauss.fastBlur(image, size, sigma); + var result = vision.algorithms.Gauss.fastBlur(image, size, sigma); + + return { + testName: "vision.algorithms.Gauss.fastBlur", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Gauss.fastBlur", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Gauss.fastBlur", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/HistogramTests.hx b/tests/generated/src/tests/HistogramTests.hx index 51525438..e9657798 100644 --- a/tests/generated/src/tests/HistogramTests.hx +++ b/tests/generated/src/tests/HistogramTests.hx @@ -9,78 +9,94 @@ import haxe.ds.IntMap; @:access(vision.ds.Histogram) class HistogramTests { public static function vision_ds_Histogram__length__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Histogram(); - result = object.length; + var result = object.length; + + return { + testName: "vision.ds.Histogram#length", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Histogram#length", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Histogram#length", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Histogram__median__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Histogram(); - result = object.median; + var result = object.median; + + return { + testName: "vision.ds.Histogram#median", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Histogram#median", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Histogram#median", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Histogram__increment_Int_Histogram__ShouldWork():TestResult { - var result = null; try { var cell = 0; var object = new vision.ds.Histogram(); - result = object.increment(cell); - } catch (e) { + var result = object.increment(cell); - } - - return { - testName: "vision.ds.Histogram#increment", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Histogram#increment", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Histogram#increment", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Histogram__decrement_Int_Histogram__ShouldWork():TestResult { - var result = null; try { var cell = 0; var object = new vision.ds.Histogram(); - result = object.decrement(cell); - } catch (e) { + var result = object.decrement(cell); - } - - return { - testName: "vision.ds.Histogram#decrement", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Histogram#decrement", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Histogram#decrement", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/ImageHashingTests.hx b/tests/generated/src/tests/ImageHashingTests.hx index b2b1e441..dd7a0f54 100644 --- a/tests/generated/src/tests/ImageHashingTests.hx +++ b/tests/generated/src/tests/ImageHashingTests.hx @@ -12,39 +12,47 @@ import vision.ds.Image; @:access(vision.algorithms.ImageHashing) class ImageHashingTests { public static function vision_algorithms_ImageHashing__ahash_Image_Int_ByteArray__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var hashByteSize = 0; - result = vision.algorithms.ImageHashing.ahash(image, hashByteSize); + var result = vision.algorithms.ImageHashing.ahash(image, hashByteSize); + + return { + testName: "vision.algorithms.ImageHashing.ahash", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.ImageHashing.ahash", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.ImageHashing.ahash", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_ImageHashing__phash_Image_ByteArray__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.algorithms.ImageHashing.phash(image); + var result = vision.algorithms.ImageHashing.phash(image); + + return { + testName: "vision.algorithms.ImageHashing.phash", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.ImageHashing.phash", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.ImageHashing.phash", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/ImageTests.hx b/tests/generated/src/tests/ImageTests.hx index f87957bb..2839e19c 100644 --- a/tests/generated/src/tests/ImageTests.hx +++ b/tests/generated/src/tests/ImageTests.hx @@ -11,546 +11,62 @@ import vision.algorithms.BilinearInterpolation; import haxe.ds.List; import haxe.Int64; import vision.ds.Color; -import vision.exceptions.OutOfBounds; -import vision.tools.ImageTools; -import vision.ds.ImageView; -import vision.ds.ImageResizeAlgorithm; -import vision.ds.Rectangle; - -@:access(vision.ds.Image) -class ImageTests { - public static function vision_ds_Image__view__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - var object = new vision.ds.Image(width, height, color); - result = object.view; - } catch (e) { - - } - - return { - testName: "vision.ds.Image#view", - returned: result, - expected: null, - status: Unimplemented - } - } - - #if flixel - - public static function vision_ds_Image__toFlxSprite__flixelFlxSprite__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toFlxSprite(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toFlxSprite", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromFlxSprite_flixelFlxSprite_Image__ShouldWork():TestResult { - var result = null; - try { - var sprite:flixel.FlxSprite = null; - - result = vision.ds.Image.fromFlxSprite(sprite); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromFlxSprite", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if (flash || openfl) - - public static function vision_ds_Image__toBitmapData__flashdisplayBitmapData__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toBitmapData(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toBitmapData", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__toShape__flashdisplayShape__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toShape(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toShape", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__toSprite__flashdisplaySprite__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toSprite(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toSprite", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromBitmapData_flashdisplayBitmapData_Image__ShouldWork():TestResult { - var result = null; - try { - var bitmapData:flash.display.BitmapData = null; - - result = vision.ds.Image.fromBitmapData(bitmapData); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromBitmapData", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromShape_flashdisplayShape_Image__ShouldWork():TestResult { - var result = null; - try { - var shape:flash.display.Shape = null; - - result = vision.ds.Image.fromShape(shape); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromShape", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromSprite_flashdisplaySprite_Image__ShouldWork():TestResult { - var result = null; - try { - var sprite:flash.display.Sprite = null; - - result = vision.ds.Image.fromSprite(sprite); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromSprite", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if lime - - public static function vision_ds_Image__toLimeImage__limegraphicsImage__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toLimeImage(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toLimeImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - - public static function vision_ds_Image__fromLimeImage_limegraphicsImage_Image__ShouldWork():TestResult { - var result = null; - try { - var image:lime.graphics.Image = null; - - result = vision.ds.Image.fromLimeImage(image); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromLimeImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if kha - - public static function vision_ds_Image__fromKhaImage_khaImage_Image__ShouldWork():TestResult { - var result = null; - try { - var image:kha.Image = null; - - result = vision.ds.Image.fromKhaImage(image); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromKhaImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if heaps - - public static function vision_ds_Image__toHeapsPixels__hxdPixels__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toHeapsPixels(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toHeapsPixels", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromHeapsPixels_hxdPixels_Image__ShouldWork():TestResult { - var result = null; - try { - var pixels:hxd.Pixels = null; - - result = vision.ds.Image.fromHeapsPixels(pixels); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromHeapsPixels", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if js - - public static function vision_ds_Image__toJsCanvas__jshtmlCanvasElement__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toJsCanvas(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toJsCanvas", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__toJsImage__jshtmlImageElement__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toJsImage(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toJsImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromJsCanvas_jshtmlCanvasElement_Image__ShouldWork():TestResult { - var result = null; - try { - var canvas:js.html.CanvasElement = null; - - result = vision.ds.Image.fromJsCanvas(canvas); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromJsCanvas", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromJsImage_jshtmlImageElement_Image__ShouldWork():TestResult { - var result = null; - try { - var image:js.html.ImageElement = null; - - result = vision.ds.Image.fromJsImage(image); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromJsImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - #if haxeui - - public static function vision_ds_Image__toHaxeUIImage__haxeuicomponentsImage__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toHaxeUIImage(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toHaxeUIImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__toHaxeUIImageData__haxeuibackendImageData__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toHaxeUIImageData(); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#toHaxeUIImageData", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromHaxeUIImage_haxeuicomponentsImage_Image__ShouldWork():TestResult { - var result = null; - try { - var image:haxe.ui.components.Image = null; - - result = vision.ds.Image.fromHaxeUIImage(image); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromHaxeUIImage", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__fromHaxeUIImageData_haxeuibackendImageData_Image__ShouldWork():TestResult { - var result = null; - try { - var image:haxe.ui.backend.ImageData = null; - - result = vision.ds.Image.fromHaxeUIImageData(image); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.fromHaxeUIImageData", - returned: result, - expected: null, - status: Unimplemented - } - } - - #end - - public static function vision_ds_Image__from2DArray_Array_Image__ShouldWork():TestResult { - var result = null; - try { - var array = []; - - result = vision.ds.Image.from2DArray(array); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.from2DArray", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__loadFromBytes_ByteArray_Int_Int_Image__ShouldWork():TestResult { - var result = null; - try { - var bytes = vision.ds.ByteArray.from(0); - var width = 0; - var height = 0; - - result = vision.ds.Image.loadFromBytes(bytes, width, height); - } catch (e) { - - } - - return { - testName: "vision.ds.Image.loadFromBytes", - returned: result, - expected: null, - status: Unimplemented - } - } +import vision.ds.Rectangle; +import vision.ds.ImageView; +import vision.ds.ImageResizeAlgorithm; +import vision.exceptions.OutOfBounds; +import vision.tools.ImageTools; - public static function vision_ds_Image__getPixel_Int_Int_Color__ShouldWork():TestResult { - var result = null; - try { +@:access(vision.ds.Image) +class ImageTests { + public static function vision_ds_Image__view__ShouldWork():TestResult { + try { var width = 0; var height = 0; var color:Color = null; - var x = 0; - var y = 0; - var object = new vision.ds.Image(width, height, color); - result = object.getPixel(x, y); + var result = object.view; + + return { + testName: "vision.ds.Image#view", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - + return { + testName: "vision.ds.Image#view", + returned: e, + expected: null, + status: Failure + } } + } + + public static function vision_ds_Image__from2DArray_Array_Image__ShouldWork():TestResult { + try { + var array = []; + + var result = vision.ds.Image.from2DArray(array); - return { - testName: "vision.ds.Image#getPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image.from2DArray", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image.from2DArray", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__getSafePixel_Int_Int_Color__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -560,21 +76,25 @@ class ImageTests { var y = 0; var object = new vision.ds.Image(width, height, color); - result = object.getSafePixel(x, y); - } catch (e) { + var result = object.getSafePixel(x, y); - } - - return { - testName: "vision.ds.Image#getSafePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#getSafePixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#getSafePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__getFloatingPixel_Float_Float_Color__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -584,21 +104,25 @@ class ImageTests { var y = 0.0; var object = new vision.ds.Image(width, height, color); - result = object.getFloatingPixel(x, y); - } catch (e) { + var result = object.getFloatingPixel(x, y); - } - - return { - testName: "vision.ds.Image#getFloatingPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#getFloatingPixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#getFloatingPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__setPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -610,20 +134,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.setPixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#setPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#setPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#setPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__setSafePixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -635,20 +163,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.setSafePixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#setSafePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#setSafePixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#setSafePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__setFloatingPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -660,20 +192,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.setFloatingPixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#setFloatingPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#setFloatingPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#setFloatingPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__paintPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -685,20 +221,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.paintPixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#paintPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#paintPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#paintPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__paintFloatingPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -710,20 +250,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.paintFloatingPixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#paintFloatingPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#paintFloatingPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#paintFloatingPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__paintSafePixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -735,20 +279,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.paintSafePixel(x, y, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#paintSafePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#paintSafePixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#paintSafePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__hasPixel_Float_Float_Bool__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -758,21 +306,25 @@ class ImageTests { var y = 0.0; var object = new vision.ds.Image(width, height, color); - result = object.hasPixel(x, y); - } catch (e) { + var result = object.hasPixel(x, y); - } - - return { - testName: "vision.ds.Image#hasPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#hasPixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#hasPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__movePixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -786,20 +338,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.movePixel(fromX, fromY, toX, toY, oldPixelResetColor); - } catch (e) { - } - - return { - testName: "vision.ds.Image#movePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#movePixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#movePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__moveSafePixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -813,20 +369,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.moveSafePixel(fromX, fromY, toX, toY, oldPixelResetColor); - } catch (e) { - } - - return { - testName: "vision.ds.Image#moveSafePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#moveSafePixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#moveSafePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__moveFloatingPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -840,20 +400,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.moveFloatingPixel(fromX, fromY, toX, toY, oldPixelResetColor); - } catch (e) { - } - - return { - testName: "vision.ds.Image#moveFloatingPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#moveFloatingPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#moveFloatingPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__moveUnsafePixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -867,20 +431,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.moveUnsafePixel(fromX, fromY, toX, toY, oldPixelResetColor); - } catch (e) { - } - - return { - testName: "vision.ds.Image#moveUnsafePixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#moveUnsafePixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#moveUnsafePixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__copyPixelFrom_Image_Int_Int_Color__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -891,21 +459,25 @@ class ImageTests { var y = 0; var object = new vision.ds.Image(width, height, color); - result = object.copyPixelFrom(image, x, y); - } catch (e) { + var result = object.copyPixelFrom(image, x, y); - } - - return { - testName: "vision.ds.Image#copyPixelFrom", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#copyPixelFrom", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#copyPixelFrom", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__copyPixelTo_Image_Int_Int_Color__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -916,21 +488,25 @@ class ImageTests { var y = 0; var object = new vision.ds.Image(width, height, color); - result = object.copyPixelTo(image, x, y); - } catch (e) { + var result = object.copyPixelTo(image, x, y); - } - - return { - testName: "vision.ds.Image#copyPixelTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#copyPixelTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#copyPixelTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__copyImageFrom_Image_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -939,21 +515,25 @@ class ImageTests { var image = new vision.ds.Image(100, 100); var object = new vision.ds.Image(width, height, color); - result = object.copyImageFrom(image); - } catch (e) { + var result = object.copyImageFrom(image); - } - - return { - testName: "vision.ds.Image#copyImageFrom", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#copyImageFrom", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#copyImageFrom", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__getImagePortion_Rectangle_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -962,21 +542,25 @@ class ImageTests { var rect:Rectangle = null; var object = new vision.ds.Image(width, height, color); - result = object.getImagePortion(rect); - } catch (e) { + var result = object.getImagePortion(rect); - } - - return { - testName: "vision.ds.Image#getImagePortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#getImagePortion", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#getImagePortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__setImagePortion__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -987,20 +571,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.setImagePortion(rect, image); - } catch (e) { - } - - return { - testName: "vision.ds.Image#setImagePortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#setImagePortion", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#setImagePortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawLine__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1014,20 +602,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawLine(x1, y1, x2, y2, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawLine", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawLine", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawLine", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawRay2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1038,20 +630,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawRay2D(line, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawRay2D", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawLine2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1062,20 +658,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawLine2D(line, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawLine2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawLine2D", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawLine2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillRect__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1089,20 +689,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillRect(x, y, width, height, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillRect", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillRect", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillRect", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawRect__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1116,20 +720,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawRect(x, y, width, height, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawRect", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawRect", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawRect", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawQuadraticBezier__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1142,20 +750,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawQuadraticBezier(line, control, color, accuracy); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawQuadraticBezier", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawQuadraticBezier", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawQuadraticBezier", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawCubicBezier__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1169,20 +781,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawCubicBezier(line, control1, control2, color, accuracy); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawCubicBezier", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawCubicBezier", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawCubicBezier", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillCircle__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1195,20 +811,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillCircle(X, Y, r, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillCircle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillCircle", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillCircle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawCircle__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1221,20 +841,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawCircle(X, Y, r, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawCircle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawCircle", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawCircle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillEllipse__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1248,20 +872,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillEllipse(centerX, centerY, radiusX, radiusY, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillEllipse", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillEllipse", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillEllipse", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__drawEllipse__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1275,20 +903,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.drawEllipse(centerX, centerY, radiusX, radiusY, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#drawEllipse", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#drawEllipse", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#drawEllipse", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillColorRecursive__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1299,20 +931,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillColorRecursive(position, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillColorRecursive", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillColorRecursive", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillColorRecursive", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillColor__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1323,20 +959,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillColor(position, color); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillColor", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillColor", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillColor", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__fillUntilColor__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1348,20 +988,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.fillUntilColor(position, color, borderColor); - } catch (e) { - } - - return { - testName: "vision.ds.Image#fillUntilColor", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#fillUntilColor", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#fillUntilColor", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__clone__Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1369,21 +1013,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.clone(); - } catch (e) { + var result = object.clone(); - } - - return { - testName: "vision.ds.Image#clone", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#clone", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#clone", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__mirror__Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1391,21 +1039,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.mirror(); - } catch (e) { + var result = object.mirror(); - } - - return { - testName: "vision.ds.Image#mirror", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#mirror", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#mirror", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__flip__Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1413,21 +1065,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.flip(); - } catch (e) { + var result = object.flip(); - } - - return { - testName: "vision.ds.Image#flip", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#flip", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#flip", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__stamp_Int_Int_Image_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1438,21 +1094,25 @@ class ImageTests { var image = new vision.ds.Image(100, 100); var object = new vision.ds.Image(width, height, color); - result = object.stamp(X, Y, image); - } catch (e) { + var result = object.stamp(X, Y, image); - } - - return { - testName: "vision.ds.Image#stamp", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#stamp", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#stamp", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__resize_Int_Int_ImageResizeAlgorithm_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1463,21 +1123,25 @@ class ImageTests { var algorithm:ImageResizeAlgorithm = null; var object = new vision.ds.Image(width, height, color); - result = object.resize(newWidth, newHeight, algorithm); - } catch (e) { + var result = object.resize(newWidth, newHeight, algorithm); - } - - return { - testName: "vision.ds.Image#resize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#resize", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#resize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__rotate_Float_Bool_Bool_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1488,21 +1152,25 @@ class ImageTests { var expandImageBounds = false; var object = new vision.ds.Image(width, height, color); - result = object.rotate(angle, degrees, expandImageBounds); - } catch (e) { + var result = object.rotate(angle, degrees, expandImageBounds); - } - - return { - testName: "vision.ds.Image#rotate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#rotate", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#rotate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__toString_Bool_String__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1511,21 +1179,25 @@ class ImageTests { var special = false; var object = new vision.ds.Image(width, height, color); - result = object.toString(special); - } catch (e) { + var result = object.toString(special); - } - - return { - testName: "vision.ds.Image#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__forEachPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1535,20 +1207,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.forEachPixel(callback); - } catch (e) { - } - - return { - testName: "vision.ds.Image#forEachPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#forEachPixel", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#forEachPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__forEachPixelInView__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1558,20 +1234,24 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); object.forEachPixelInView(callback); - } catch (e) { - } - - return { - testName: "vision.ds.Image#forEachPixelInView", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#forEachPixelInView", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#forEachPixelInView", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__iterator__IteratorPixel__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1579,21 +1259,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.iterator(); - } catch (e) { + var result = object.iterator(); - } - - return { - testName: "vision.ds.Image#iterator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#iterator", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#iterator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__center__Point2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1601,21 +1285,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.center(); - } catch (e) { + var result = object.center(); - } - - return { - testName: "vision.ds.Image#center", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#center", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#center", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__pixelToRelative_Point2D_Point2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1624,21 +1312,25 @@ class ImageTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.Image(width, height, color); - result = object.pixelToRelative(point); - } catch (e) { + var result = object.pixelToRelative(point); - } - - return { - testName: "vision.ds.Image#pixelToRelative", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#pixelToRelative", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#pixelToRelative", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__pixelToRelative_Float_Float_Point2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1648,21 +1340,25 @@ class ImageTests { var y = 0.0; var object = new vision.ds.Image(width, height, color); - result = object.pixelToRelative(x, y); - } catch (e) { + var result = object.pixelToRelative(x, y); - } - - return { - testName: "vision.ds.Image#pixelToRelative", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#pixelToRelative", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#pixelToRelative", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__relativeToPixel_Point2D_Point2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1671,21 +1367,25 @@ class ImageTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.Image(width, height, color); - result = object.relativeToPixel(point); - } catch (e) { + var result = object.relativeToPixel(point); - } - - return { - testName: "vision.ds.Image#relativeToPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#relativeToPixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#relativeToPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__relativeToPixel_Float_Float_Point2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1695,21 +1395,25 @@ class ImageTests { var y = 0.0; var object = new vision.ds.Image(width, height, color); - result = object.relativeToPixel(x, y); - } catch (e) { + var result = object.relativeToPixel(x, y); - } - - return { - testName: "vision.ds.Image#relativeToPixel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#relativeToPixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#relativeToPixel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__hasView__Bool__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1717,21 +1421,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.hasView(); - } catch (e) { + var result = object.hasView(); - } - - return { - testName: "vision.ds.Image#hasView", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#hasView", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#hasView", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__setView_ImageView_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1740,21 +1448,25 @@ class ImageTests { var view:ImageView = null; var object = new vision.ds.Image(width, height, color); - result = object.setView(view); - } catch (e) { + var result = object.setView(view); - } - - return { - testName: "vision.ds.Image#setView", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#setView", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#setView", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__getView__ImageView__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1762,21 +1474,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.getView(); - } catch (e) { + var result = object.getView(); - } - - return { - testName: "vision.ds.Image#getView", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#getView", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#getView", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__removeView__Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1784,21 +1500,25 @@ class ImageTests { var object = new vision.ds.Image(width, height, color); - result = object.removeView(); - } catch (e) { + var result = object.removeView(); - } - - return { - testName: "vision.ds.Image#removeView", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#removeView", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#removeView", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__copyViewFrom_Image_Image__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1807,21 +1527,25 @@ class ImageTests { var from = new vision.ds.Image(100, 100); var object = new vision.ds.Image(width, height, color); - result = object.copyViewFrom(from); - } catch (e) { + var result = object.copyViewFrom(from); - } - - return { - testName: "vision.ds.Image#copyViewFrom", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#copyViewFrom", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Image#copyViewFrom", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Image__hasPixelInView_Int_Int_ImageView_Bool__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -1832,60 +1556,23 @@ class ImageTests { var v:ImageView = null; var object = new vision.ds.Image(width, height, color); - result = object.hasPixelInView(x, y, v); - } catch (e) { - - } - - return { - testName: "vision.ds.Image#hasPixelInView", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_ds_Image__to2DArray__ArrayArrayColor__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - + var result = object.hasPixelInView(x, y, v); - var object = new vision.ds.Image(width, height, color); - result = object.to2DArray(); + return { + testName: "vision.ds.Image#hasPixelInView", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Image#to2DArray", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Image#hasPixelInView", + returned: e, + expected: null, + status: Failure + } } } - public static function vision_ds_Image__toArray__ArrayColor__ShouldWork():TestResult { - var result = null; - try { - var width = 0; - var height = 0; - var color:Color = null; - - - var object = new vision.ds.Image(width, height, color); - result = object.toArray(); - } catch (e) { - - } - return { - testName: "vision.ds.Image#toArray", - returned: result, - expected: null, - status: Unimplemented - } - } } \ No newline at end of file diff --git a/tests/generated/src/tests/ImageToolsTests.hx b/tests/generated/src/tests/ImageToolsTests.hx new file mode 100644 index 00000000..105db84e --- /dev/null +++ b/tests/generated/src/tests/ImageToolsTests.hx @@ -0,0 +1,267 @@ +package tests; + +import TestResult; +import TestStatus; + +import vision.tools.ImageTools; +import haxe.Http; +import vision.formats.ImageIO; +import haxe.io.Path; +import haxe.crypto.Base64; +import haxe.io.BytesOutput; +import vision.ds.ByteArray; +import vision.exceptions.ImageLoadingFailed; +import vision.exceptions.ImageSavingFailed; +import vision.exceptions.LibraryRequired; +import vision.ds.ImageFormat; +import vision.ds.Array2D; +import vision.exceptions.Unimplemented; +import vision.exceptions.WebResponseError; +import vision.ds.ImageResizeAlgorithm; +import haxe.ds.Vector; +import vision.ds.IntPoint2D; +import vision.ds.Point2D; +import vision.ds.Color; +import vision.ds.Image; + +@:access(vision.tools.ImageTools) +class ImageToolsTests { + public static function vision_tools_ImageTools__loadFromFile__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var path = ""; + var onComplete = (_) -> null; + + vision.tools.ImageTools.loadFromFile(image, path, onComplete); + + return { + testName: "vision.tools.ImageTools.loadFromFile", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.loadFromFile", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__saveToFile__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var pathWithFileName = ""; + var saveFormat:ImageFormat = null; + + vision.tools.ImageTools.saveToFile(image, pathWithFileName, saveFormat); + + return { + testName: "vision.tools.ImageTools.saveToFile", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.saveToFile", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__loadFromBytes_Image_ByteArray_ImageFormat_Image__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var bytes = vision.ds.ByteArray.from(0); + var fileFormat:ImageFormat = null; + + var result = vision.tools.ImageTools.loadFromBytes(image, bytes, fileFormat); + + return { + testName: "vision.tools.ImageTools.loadFromBytes", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.loadFromBytes", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__loadFromFile_Image_String_Image__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var path = ""; + + var result = vision.tools.ImageTools.loadFromFile(image, path); + + return { + testName: "vision.tools.ImageTools.loadFromFile", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.loadFromFile", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__loadFromURL_Image_String_Image__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var url = ""; + + var result = vision.tools.ImageTools.loadFromURL(image, url); + + return { + testName: "vision.tools.ImageTools.loadFromURL", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.loadFromURL", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__exportToBytes_Image_ImageFormat_ByteArray__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var format:ImageFormat = null; + + var result = vision.tools.ImageTools.exportToBytes(image, format); + + return { + testName: "vision.tools.ImageTools.exportToBytes", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.exportToBytes", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__exportToFile__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var pathWithFileName = ""; + var format:ImageFormat = null; + + vision.tools.ImageTools.exportToFile(image, pathWithFileName, format); + + return { + testName: "vision.tools.ImageTools.exportToFile", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.exportToFile", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__addToScreen_Image_Int_Int_xUnitsStringyUnitsStringzIndexString_Image__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var x = 0; + var y = 0; + var units:{?xUnits:String, ?yUnits:String, ?zIndex:String} = null; + + var result = vision.tools.ImageTools.addToScreen(image, x, y, units); + + return { + testName: "vision.tools.ImageTools.addToScreen", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.addToScreen", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__getNeighborsOfPixel_Image_Int_Int_Int_Array2DColor__ShouldWork():TestResult { + try { + var image = new vision.ds.Image(100, 100); + var x = 0; + var y = 0; + var kernelSize = 0; + + var result = vision.tools.ImageTools.getNeighborsOfPixel(image, x, y, kernelSize); + + return { + testName: "vision.tools.ImageTools.getNeighborsOfPixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.getNeighborsOfPixel", + returned: e, + expected: null, + status: Failure + } + } + } + + public static function vision_tools_ImageTools__grayscalePixel_Color_Color__ShouldWork():TestResult { + try { + var pixel:Color = null; + + var result = vision.tools.ImageTools.grayscalePixel(pixel); + + return { + testName: "vision.tools.ImageTools.grayscalePixel", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.ImageTools.grayscalePixel", + returned: e, + expected: null, + status: Failure + } + } + } + + +} \ No newline at end of file diff --git a/tests/generated/src/tests/ImageViewTests.hx b/tests/generated/src/tests/ImageViewTests.hx index ca72d54c..ad5ce948 100644 --- a/tests/generated/src/tests/ImageViewTests.hx +++ b/tests/generated/src/tests/ImageViewTests.hx @@ -9,21 +9,25 @@ import vision.ds.ImageViewShape; @:access(vision.ds.ImageView) class ImageViewTests { public static function vision_ds_ImageView__toString__String__ShouldWork():TestResult { - var result = null; try { - var object:ImageView = {x: 0, y: 0, width: 0, height: 0, shape: RECTANGLE}; - result = object.toString(); - } catch (e) { + var object = ({} : ImageView); + var result = object.toString(); - } - - return { - testName: "vision.ds.ImageView#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.ImageView#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.ImageView#toString", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Int16Point2DTests.hx b/tests/generated/src/tests/Int16Point2DTests.hx index ef5b72de..efc3511a 100644 --- a/tests/generated/src/tests/Int16Point2DTests.hx +++ b/tests/generated/src/tests/Int16Point2DTests.hx @@ -9,126 +9,150 @@ import vision.tools.MathTools; @:access(vision.ds.Int16Point2D) class Int16Point2DTests { public static function vision_ds_Int16Point2D__x__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.x; + var result = object.x; + + return { + testName: "vision.ds.Int16Point2D#x", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Int16Point2D#x", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#x", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Int16Point2D__y__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.y; + var result = object.y; + + return { + testName: "vision.ds.Int16Point2D#y", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Int16Point2D#y", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#y", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Int16Point2D__toString__String__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Int16Point2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Int16Point2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Int16Point2D__toPoint2D__Point2D__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.toPoint2D(); - } catch (e) { + var result = object.toPoint2D(); - } - - return { - testName: "vision.ds.Int16Point2D#toPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Int16Point2D#toPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Int16Point2D__toIntPoint2D__Point2D__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.toIntPoint2D(); - } catch (e) { + var result = object.toIntPoint2D(); - } - - return { - testName: "vision.ds.Int16Point2D#toIntPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#toIntPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Int16Point2D#toIntPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Int16Point2D__toInt__Int__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.Int16Point2D(X, Y); - result = object.toInt(); - } catch (e) { + var result = object.toInt(); - } - - return { - testName: "vision.ds.Int16Point2D#toInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Int16Point2D#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Int16Point2D#toInt", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index c061d7b0..5261b2db 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -11,128 +11,151 @@ import haxe.Int64; @:access(vision.ds.IntPoint2D) class IntPoint2DTests { public static function vision_ds_IntPoint2D__x__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; var object = new vision.ds.IntPoint2D(x, y); - result = object.x; + var result = object.x; + + return { + testName: "vision.ds.IntPoint2D#x", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.IntPoint2D#x", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#x", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__y__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; var object = new vision.ds.IntPoint2D(x, y); - result = object.y; + var result = object.y; + + return { + testName: "vision.ds.IntPoint2D#y", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.IntPoint2D#y", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#y", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__fromPoint2D_Point2D_IntPoint2D__ShouldWork():TestResult { - var result = null; try { var p = new vision.ds.Point2D(0, 0); - result = vision.ds.IntPoint2D.fromPoint2D(p); + var result = vision.ds.IntPoint2D.fromPoint2D(p); + + return { + testName: "vision.ds.IntPoint2D.fromPoint2D", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.IntPoint2D.fromPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D.fromPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__toPoint2D__Point2D__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; var object = new vision.ds.IntPoint2D(x, y); - result = object.toPoint2D(); - } catch (e) { + var result = object.toPoint2D(); - } - - return { - testName: "vision.ds.IntPoint2D#toPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#toPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__toString__String__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; var object = new vision.ds.IntPoint2D(x, y); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.IntPoint2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__copy__IntPoint2D__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; var object = new vision.ds.IntPoint2D(x, y); - result = object.copy(); - } catch (e) { + var result = object.copy(); - } - - return { - testName: "vision.ds.IntPoint2D#copy", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#copy", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__distanceTo_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; @@ -140,21 +163,25 @@ class IntPoint2DTests { var point = new vision.ds.IntPoint2D(0, 0); var object = new vision.ds.IntPoint2D(x, y); - result = object.distanceTo(point); - } catch (e) { + var result = object.distanceTo(point); - } - - return { - testName: "vision.ds.IntPoint2D#distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#distanceTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__degreesTo_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; @@ -162,21 +189,25 @@ class IntPoint2DTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.IntPoint2D(x, y); - result = object.degreesTo(point); - } catch (e) { + var result = object.degreesTo(point); - } - - return { - testName: "vision.ds.IntPoint2D#degreesTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#degreesTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#degreesTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_IntPoint2D__radiansTo_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0; var y = 0; @@ -184,16 +215,21 @@ class IntPoint2DTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.IntPoint2D(x, y); - result = object.radiansTo(point); - } catch (e) { + var result = object.radiansTo(point); - } - - return { - testName: "vision.ds.IntPoint2D#radiansTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.IntPoint2D#radiansTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.IntPoint2D#radiansTo", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/KMeansTests.hx b/tests/generated/src/tests/KMeansTests.hx index 3f2196cd..d0aceea2 100644 --- a/tests/generated/src/tests/KMeansTests.hx +++ b/tests/generated/src/tests/KMeansTests.hx @@ -12,62 +12,74 @@ import vision.exceptions.Unimplemented; @:access(vision.algorithms.KMeans) class KMeansTests { public static function vision_algorithms_KMeans__generateClustersUsingConvergence_ArrayT_Int_TTFloat_ArrayTT_ArrayArrayT__ShouldWork():TestResult { - var result = null; try { var values = []; var clusterAmount = 0; var distanceFunction = (_, _) -> null; var averageFunction = (_) -> null; - result = vision.algorithms.KMeans.generateClustersUsingConvergence(values, clusterAmount, distanceFunction, averageFunction); - } catch (e) { - - } + var result = vision.algorithms.KMeans.generateClustersUsingConvergence(values, clusterAmount, distanceFunction, averageFunction); - return { - testName: "vision.algorithms.KMeans.generateClustersUsingConvergence", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.KMeans.generateClustersUsingConvergence", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.KMeans.generateClustersUsingConvergence", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_KMeans__getImageColorClusters_Image_Int_ArrayColorCluster__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var clusterAmount = 0; - result = vision.algorithms.KMeans.getImageColorClusters(image, clusterAmount); - } catch (e) { - - } + var result = vision.algorithms.KMeans.getImageColorClusters(image, clusterAmount); - return { - testName: "vision.algorithms.KMeans.getImageColorClusters", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.KMeans.getImageColorClusters", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.KMeans.getImageColorClusters", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_KMeans__pickElementsAtRandom_ArrayT_Int_Bool_ArrayT__ShouldWork():TestResult { - var result = null; try { var values = []; var amount = 0; var distinct = false; - result = vision.algorithms.KMeans.pickElementsAtRandom(values, amount, distinct); - } catch (e) { - - } + var result = vision.algorithms.KMeans.pickElementsAtRandom(values, amount, distinct); - return { - testName: "vision.algorithms.KMeans.pickElementsAtRandom", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.KMeans.pickElementsAtRandom", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.KMeans.pickElementsAtRandom", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/LaplaceTests.hx b/tests/generated/src/tests/LaplaceTests.hx index 7f35fe9f..333a990d 100644 --- a/tests/generated/src/tests/LaplaceTests.hx +++ b/tests/generated/src/tests/LaplaceTests.hx @@ -12,26 +12,29 @@ import vision.ds.Image; @:access(vision.algorithms.Laplace) class LaplaceTests { public static function vision_algorithms_Laplace__convolveWithLaplacianOperator_Image_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var positive = false; - result = vision.algorithms.Laplace.convolveWithLaplacianOperator(image, positive); - } catch (e) { - - } + var result = vision.algorithms.Laplace.convolveWithLaplacianOperator(image, positive); - return { - testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Laplace.convolveWithLaplacianOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Laplace__laplacianOfGaussian_Image_GaussianKernelSize_Float_Float_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var kernelSize:GaussianKernelSize = null; @@ -39,16 +42,21 @@ class LaplaceTests { var threshold = 0.0; var positive = false; - result = vision.algorithms.Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, positive); - } catch (e) { - - } + var result = vision.algorithms.Laplace.laplacianOfGaussian(image, kernelSize, sigma, threshold, positive); - return { - testName: "vision.algorithms.Laplace.laplacianOfGaussian", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Laplace.laplacianOfGaussian", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Laplace.laplacianOfGaussian", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Line2DTests.hx b/tests/generated/src/tests/Line2DTests.hx index ed51f384..c47a2cbb 100644 --- a/tests/generated/src/tests/Line2DTests.hx +++ b/tests/generated/src/tests/Line2DTests.hx @@ -9,65 +9,76 @@ import vision.tools.MathTools; @:access(vision.ds.Line2D) class Line2DTests { public static function vision_ds_Line2D__length__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); var object = new vision.ds.Line2D(start, end); - result = object.length; + var result = object.length; + + return { + testName: "vision.ds.Line2D#length", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Line2D#length", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#length", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__middle__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); var object = new vision.ds.Line2D(start, end); - result = object.middle; + var result = object.middle; + + return { + testName: "vision.ds.Line2D#middle", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Line2D#middle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#middle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__fromRay2D_Ray2D_Line2D__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.ds.Line2D.fromRay2D(ray); + var result = vision.ds.Line2D.fromRay2D(ray); + + return { + testName: "vision.ds.Line2D.fromRay2D", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Line2D.fromRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D.fromRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__intersect_Line2D_Point2D__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); @@ -75,21 +86,25 @@ class Line2DTests { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var object = new vision.ds.Line2D(start, end); - result = object.intersect(line); - } catch (e) { + var result = object.intersect(line); - } - - return { - testName: "vision.ds.Line2D#intersect", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#intersect", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Line2D#intersect", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__distanceTo_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); @@ -97,58 +112,71 @@ class Line2DTests { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var object = new vision.ds.Line2D(start, end); - result = object.distanceTo(line); - } catch (e) { + var result = object.distanceTo(line); - } - - return { - testName: "vision.ds.Line2D#distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Line2D#distanceTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__toString__String__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); var object = new vision.ds.Line2D(start, end); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Line2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Line2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Line2D__toRay2D__Ray2D__ShouldWork():TestResult { - var result = null; try { var start = new vision.ds.Point2D(0, 0); var end = new vision.ds.Point2D(0, 0); var object = new vision.ds.Line2D(start, end); - result = object.toRay2D(); - } catch (e) { + var result = object.toRay2D(); - } - - return { - testName: "vision.ds.Line2D#toRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Line2D#toRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Line2D#toRay2D", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index af17bfd5..aa1cee34 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -15,1357 +15,1649 @@ import vision.ds.Point2D; @:access(vision.tools.MathTools) class MathToolsTests { public static function vision_tools_MathTools__PI__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.PI; - } catch (e) { - - } + var result = vision.tools.MathTools.PI; - return { - testName: "vision.tools.MathTools.PI", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.PI", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.PI", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__PI_OVER_2__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.PI_OVER_2; - } catch (e) { - - } + var result = vision.tools.MathTools.PI_OVER_2; - return { - testName: "vision.tools.MathTools.PI_OVER_2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.PI_OVER_2", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.PI_OVER_2", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__NEGATIVE_INFINITY__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.NEGATIVE_INFINITY; - } catch (e) { - - } + var result = vision.tools.MathTools.NEGATIVE_INFINITY; - return { - testName: "vision.tools.MathTools.NEGATIVE_INFINITY", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.NEGATIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.NEGATIVE_INFINITY", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__POSITIVE_INFINITY__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.POSITIVE_INFINITY; - } catch (e) { - - } + var result = vision.tools.MathTools.POSITIVE_INFINITY; - return { - testName: "vision.tools.MathTools.POSITIVE_INFINITY", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.POSITIVE_INFINITY", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.POSITIVE_INFINITY", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__NaN__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.NaN; - } catch (e) { - - } + var result = vision.tools.MathTools.NaN; - return { - testName: "vision.tools.MathTools.NaN", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.NaN", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.NaN", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__SQRT2__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.SQRT2; - } catch (e) { - - } + var result = vision.tools.MathTools.SQRT2; - return { - testName: "vision.tools.MathTools.SQRT2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.SQRT2", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.SQRT2", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__SQRT3__ShouldWork():TestResult { - var result = null; try { - result = vision.tools.MathTools.SQRT3; - } catch (e) { - - } + var result = vision.tools.MathTools.SQRT3; - return { - testName: "vision.tools.MathTools.SQRT3", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.SQRT3", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.SQRT3", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromRayToPoint2D_Ray2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var point = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); - return { - testName: "vision.tools.MathTools.distanceFromRayToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromRayToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromRayToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__intersectionBetweenRay2Ds_Ray2D_Ray2D_Point2D__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); - } catch (e) { - - } + var result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); - return { - testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenRays2D_Ray2D_Ray2D_Float__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); - return { - testName: "vision.tools.MathTools.distanceBetweenRays2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenRays2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenRays2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__findPointAtDistanceUsingX_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var startXPos = 0.0; var distance = 0.0; var goPositive = false; - result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); - } catch (e) { - - } + var result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); - return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingX", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingX", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingX", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__findPointAtDistanceUsingY_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { - var result = null; try { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var startYPos = 0.0; var distance = 0.0; var goPositive = false; - result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); - } catch (e) { - - } + var result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); - return { - testName: "vision.tools.MathTools.findPointAtDistanceUsingY", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingY", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.findPointAtDistanceUsingY", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var point = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); - return { - testName: "vision.tools.MathTools.distanceFromLineToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenLines2D_Line2D_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); - return { - testName: "vision.tools.MathTools.distanceBetweenLines2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenLines2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenLines2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var point = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.radiansFromLineToPoint2D(line, point); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromLineToPoint2D(line, point); - return { - testName: "vision.tools.MathTools.radiansFromLineToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromLineToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromLineToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__intersectionBetweenLine2Ds_Line2D_Line2D_Point2D__ShouldWork():TestResult { - var result = null; try { var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); - } catch (e) { - - } + var result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); - return { - testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__mirrorInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { - var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var rect:Rectangle = null; - result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); - } catch (e) { - - } + var result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); - return { - testName: "vision.tools.MathTools.mirrorInsideRectangle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.mirrorInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.mirrorInsideRectangle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__flipInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { - var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var rect:Rectangle = null; - result = vision.tools.MathTools.flipInsideRectangle(line, rect); - } catch (e) { - - } + var result = vision.tools.MathTools.flipInsideRectangle(line, rect); - return { - testName: "vision.tools.MathTools.flipInsideRectangle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.flipInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.flipInsideRectangle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__invertInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { - var result = null; try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var rect:Rectangle = null; - result = vision.tools.MathTools.invertInsideRectangle(line, rect); - } catch (e) { - - } + var result = vision.tools.MathTools.invertInsideRectangle(line, rect); - return { - testName: "vision.tools.MathTools.invertInsideRectangle", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.invertInsideRectangle", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.invertInsideRectangle", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromPointToRay2D_Point2D_Ray2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); - return { - testName: "vision.tools.MathTools.distanceFromPointToRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromPointToLine2D_Point2D_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); - return { - testName: "vision.tools.MathTools.distanceFromPointToLine2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToLine2D_Point2D_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); - return { - testName: "vision.tools.MathTools.radiansFromPointToLine2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeFromPointToPoint2D_Point2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenPoints_Point2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeFromPointToPoint2D_Point2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenPoints_Point2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__getClosestPointOnRay2D_Point2D_Ray2D_Point2D__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); - } catch (e) { - - } + var result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); - return { - testName: "vision.tools.MathTools.getClosestPointOnRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromPointToRay2D_IntPoint2D_Ray2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.IntPoint2D(0, 0); var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); - return { - testName: "vision.tools.MathTools.distanceFromPointToRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromPointToRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceFromPointToLine2D_IntPoint2D_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.IntPoint2D(0, 0); var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); - return { - testName: "vision.tools.MathTools.distanceFromPointToLine2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceFromPointToLine2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToLine2D_IntPoint2D_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.IntPoint2D(0, 0); var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToLine2D(point, line); - return { - testName: "vision.tools.MathTools.radiansFromPointToLine2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToLine2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeFromPointToPoint2D_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenPoints_IntPoint2D_IntPoint2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.IntPoint2D(0, 0); - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.radiansFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.degreesFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeFromPointToPoint2D_IntPoint2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeFromPointToPoint2D(point1, point2); - return { - testName: "vision.tools.MathTools.slopeFromPointToPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeFromPointToPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenPoints_IntPoint2D_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.IntPoint2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__getClosestPointOnRay2D_IntPoint2D_Ray2D_Point2D__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.IntPoint2D(0, 0); var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); - } catch (e) { - - } + var result = vision.tools.MathTools.getClosestPointOnRay2D(point, ray); - return { - testName: "vision.tools.MathTools.getClosestPointOnRay2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.getClosestPointOnRay2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__distanceBetweenPoints_Point3D_Point3D_Float__ShouldWork():TestResult { - var result = null; try { var point1:Point3D = null; var point2:Point3D = null; - result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - } catch (e) { - - } + var result = vision.tools.MathTools.distanceBetweenPoints(point1, point2); - return { - testName: "vision.tools.MathTools.distanceBetweenPoints", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.distanceBetweenPoints", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__clamp_Int_Int_Int_Int__ShouldWork():TestResult { - var result = null; try { var value = 0; var mi = 0; var ma = 0; - result = vision.tools.MathTools.clamp(value, mi, ma); - } catch (e) { - - } + var result = vision.tools.MathTools.clamp(value, mi, ma); - return { - testName: "vision.tools.MathTools.clamp", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.clamp", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.clamp", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__isBetweenRanges_Float_startFloatendFloat_Bool__ShouldWork():TestResult { - var result = null; try { var value = 0.0; var ranges:{start:Float, end:Float} = null; - result = vision.tools.MathTools.isBetweenRanges(value, ranges); - } catch (e) { - - } + var result = vision.tools.MathTools.isBetweenRanges(value, ranges); - return { - testName: "vision.tools.MathTools.isBetweenRanges", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.isBetweenRanges", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.isBetweenRanges", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__isBetweenRange_Float_Float_Float_Bool__ShouldWork():TestResult { - var result = null; try { var value = 0.0; var min = 0.0; var max = 0.0; - result = vision.tools.MathTools.isBetweenRange(value, min, max); - } catch (e) { - - } + var result = vision.tools.MathTools.isBetweenRange(value, min, max); - return { - testName: "vision.tools.MathTools.isBetweenRange", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.isBetweenRange", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.isBetweenRange", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__wrapInt_Int_Int_Int_Int__ShouldWork():TestResult { - var result = null; try { var value = 0; var min = 0; var max = 0; - result = vision.tools.MathTools.wrapInt(value, min, max); - } catch (e) { - - } + var result = vision.tools.MathTools.wrapInt(value, min, max); - return { - testName: "vision.tools.MathTools.wrapInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.wrapInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.wrapInt", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__wrapFloat_Float_Float_Float_Float__ShouldWork():TestResult { - var result = null; try { var value = 0.0; var min = 0.0; var max = 0.0; - result = vision.tools.MathTools.wrapFloat(value, min, max); - } catch (e) { - - } + var result = vision.tools.MathTools.wrapFloat(value, min, max); - return { - testName: "vision.tools.MathTools.wrapFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.wrapFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.wrapFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__boundInt_Int_Int_Int_Int__ShouldWork():TestResult { - var result = null; try { var value = 0; var min = 0; var max = 0; - result = vision.tools.MathTools.boundInt(value, min, max); - } catch (e) { - - } + var result = vision.tools.MathTools.boundInt(value, min, max); - return { - testName: "vision.tools.MathTools.boundInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.boundInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.boundInt", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__boundFloat_Float_Float_Float_Float__ShouldWork():TestResult { - var result = null; try { var value = 0.0; var min = 0.0; var max = 0.0; - result = vision.tools.MathTools.boundFloat(value, min, max); - } catch (e) { - - } + var result = vision.tools.MathTools.boundFloat(value, min, max); - return { - testName: "vision.tools.MathTools.boundFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.boundFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.boundFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__gamma_Float_Float__ShouldWork():TestResult { - var result = null; try { var x = 0.0; - result = vision.tools.MathTools.gamma(x); - } catch (e) { - - } + var result = vision.tools.MathTools.gamma(x); - return { - testName: "vision.tools.MathTools.gamma", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.gamma", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.gamma", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__factorial_Float_Float__ShouldWork():TestResult { - var result = null; try { var value = 0.0; - result = vision.tools.MathTools.factorial(value); - } catch (e) { - - } + var result = vision.tools.MathTools.factorial(value); - return { - testName: "vision.tools.MathTools.factorial", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.factorial", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.factorial", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeToDegrees_Float_Float__ShouldWork():TestResult { - var result = null; try { var slope = 0.0; - result = vision.tools.MathTools.slopeToDegrees(slope); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeToDegrees(slope); - return { - testName: "vision.tools.MathTools.slopeToDegrees", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeToDegrees", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeToDegrees", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__slopeToRadians_Float_Float__ShouldWork():TestResult { - var result = null; try { var slope = 0.0; - result = vision.tools.MathTools.slopeToRadians(slope); - } catch (e) { - - } + var result = vision.tools.MathTools.slopeToRadians(slope); - return { - testName: "vision.tools.MathTools.slopeToRadians", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.slopeToRadians", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.slopeToRadians", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesToSlope_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.degreesToSlope(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesToSlope(degrees); - return { - testName: "vision.tools.MathTools.degreesToSlope", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesToSlope", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesToSlope", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__degreesToRadians_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.degreesToRadians(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.degreesToRadians(degrees); - return { - testName: "vision.tools.MathTools.degreesToRadians", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.degreesToRadians", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.degreesToRadians", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansToDegrees_Float_Float__ShouldWork():TestResult { - var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.radiansToDegrees(radians); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansToDegrees(radians); - return { - testName: "vision.tools.MathTools.radiansToDegrees", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansToDegrees", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansToDegrees", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__radiansToSlope_Float_Float__ShouldWork():TestResult { - var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.radiansToSlope(radians); - } catch (e) { - - } + var result = vision.tools.MathTools.radiansToSlope(radians); - return { - testName: "vision.tools.MathTools.radiansToSlope", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.radiansToSlope", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.radiansToSlope", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cotan_Float_Float__ShouldWork():TestResult { - var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.cotan(radians); - } catch (e) { - - } + var result = vision.tools.MathTools.cotan(radians); - return { - testName: "vision.tools.MathTools.cotan", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cotan", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cotan", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cosec_Float_Float__ShouldWork():TestResult { - var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.cosec(radians); - } catch (e) { - - } + var result = vision.tools.MathTools.cosec(radians); - return { - testName: "vision.tools.MathTools.cosec", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cosec", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cosec", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__sec_Float_Float__ShouldWork():TestResult { - var result = null; try { var radians = 0.0; - result = vision.tools.MathTools.sec(radians); - } catch (e) { - - } + var result = vision.tools.MathTools.sec(radians); - return { - testName: "vision.tools.MathTools.sec", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.sec", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.sec", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__sind_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.sind(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.sind(degrees); - return { - testName: "vision.tools.MathTools.sind", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.sind", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.sind", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cosd_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.cosd(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.cosd(degrees); - return { - testName: "vision.tools.MathTools.cosd", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cosd", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cosd", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__tand_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.tand(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.tand(degrees); - return { - testName: "vision.tools.MathTools.tand", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.tand", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.tand", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cotand_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.cotand(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.cotand(degrees); - return { - testName: "vision.tools.MathTools.cotand", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cotand", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cotand", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cosecd_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.cosecd(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.cosecd(degrees); - return { - testName: "vision.tools.MathTools.cosecd", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cosecd", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cosecd", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__secd_Float_Float__ShouldWork():TestResult { - var result = null; try { var degrees = 0.0; - result = vision.tools.MathTools.secd(degrees); - } catch (e) { - - } + var result = vision.tools.MathTools.secd(degrees); - return { - testName: "vision.tools.MathTools.secd", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.secd", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.secd", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__truncate_Float_Int_Float__ShouldWork():TestResult { - var result = null; try { var num = 0.0; var numbersAfterDecimal = 0; - result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); - } catch (e) { - - } + var result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); - return { - testName: "vision.tools.MathTools.truncate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.truncate", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.truncate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__cropDecimal_Float_Int__ShouldWork():TestResult { - var result = null; try { var number = 0.0; - result = vision.tools.MathTools.cropDecimal(number); - } catch (e) { - - } + var result = vision.tools.MathTools.cropDecimal(number); - return { - testName: "vision.tools.MathTools.cropDecimal", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.cropDecimal", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.cropDecimal", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__isInt_Float_Bool__ShouldWork():TestResult { - var result = null; try { var v = 0.0; - result = vision.tools.MathTools.isInt(v); - } catch (e) { - - } + var result = vision.tools.MathTools.isInt(v); - return { - testName: "vision.tools.MathTools.isInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.isInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.isInt", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__toFloat_Int64_Float__ShouldWork():TestResult { - var result = null; try { var value:Int64 = null; - result = vision.tools.MathTools.toFloat(value); - } catch (e) { - - } + var result = vision.tools.MathTools.toFloat(value); - return { - testName: "vision.tools.MathTools.toFloat", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.tools.MathTools.toFloat", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.toFloat", + returned: e, + expected: null, + status: Failure + } } } public static function vision_tools_MathTools__parseBool_String_Bool__ShouldWork():TestResult { - var result = null; try { var s = ""; - result = vision.tools.MathTools.parseBool(s); - } catch (e) { - - } - - return { - testName: "vision.tools.MathTools.parseBool", - returned: result, - expected: null, - status: Unimplemented + var result = vision.tools.MathTools.parseBool(s); + + return { + testName: "vision.tools.MathTools.parseBool", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.tools.MathTools.parseBool", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Matrix2DTests.hx b/tests/generated/src/tests/Matrix2DTests.hx index bc84dcbc..10f8d11d 100644 --- a/tests/generated/src/tests/Matrix2DTests.hx +++ b/tests/generated/src/tests/Matrix2DTests.hx @@ -14,416 +14,499 @@ import vision.tools.MathTools.*; @:access(vision.ds.Matrix2D) class Matrix2DTests { public static function vision_ds_Matrix2D__underlying__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.underlying; + var result = object.underlying; + + return { + testName: "vision.ds.Matrix2D#underlying", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Matrix2D#underlying", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#underlying", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__rows__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.rows; + var result = object.rows; + + return { + testName: "vision.ds.Matrix2D#rows", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Matrix2D#rows", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#rows", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__columns__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.columns; + var result = object.columns; + + return { + testName: "vision.ds.Matrix2D#columns", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Matrix2D#columns", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#columns", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__IDENTITY__TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { - result = vision.ds.Matrix2D.IDENTITY(); - } catch (e) { - - } + var result = vision.ds.Matrix2D.IDENTITY(); - return { - testName: "vision.ds.Matrix2D.IDENTITY", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.IDENTITY", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.IDENTITY", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__ROTATION_Float_Bool_Point2D_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var angle = 0.0; var degrees = false; var origin = new vision.ds.Point2D(0, 0); - result = vision.ds.Matrix2D.ROTATION(angle, degrees, origin); - } catch (e) { - - } + var result = vision.ds.Matrix2D.ROTATION(angle, degrees, origin); - return { - testName: "vision.ds.Matrix2D.ROTATION", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.ROTATION", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.ROTATION", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__TRANSLATION_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; - result = vision.ds.Matrix2D.TRANSLATION(x, y); - } catch (e) { - - } + var result = vision.ds.Matrix2D.TRANSLATION(x, y); - return { - testName: "vision.ds.Matrix2D.TRANSLATION", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.TRANSLATION", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.TRANSLATION", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__SCALE_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var scaleX = 0.0; var scaleY = 0.0; - result = vision.ds.Matrix2D.SCALE(scaleX, scaleY); - } catch (e) { - - } + var result = vision.ds.Matrix2D.SCALE(scaleX, scaleY); - return { - testName: "vision.ds.Matrix2D.SCALE", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.SCALE", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.SCALE", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__SHEAR_Float_Float_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var shearX = 0.0; var shearY = 0.0; - result = vision.ds.Matrix2D.SHEAR(shearX, shearY); - } catch (e) { - - } + var result = vision.ds.Matrix2D.SHEAR(shearX, shearY); - return { - testName: "vision.ds.Matrix2D.SHEAR", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.SHEAR", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.SHEAR", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__REFLECTION_Float_Bool_Point2D_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var angle = 0.0; var degrees = false; var origin = new vision.ds.Point2D(0, 0); - result = vision.ds.Matrix2D.REFLECTION(angle, degrees, origin); - } catch (e) { - - } + var result = vision.ds.Matrix2D.REFLECTION(angle, degrees, origin); - return { - testName: "vision.ds.Matrix2D.REFLECTION", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.REFLECTION", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.REFLECTION", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__PERSPECTIVE_ArrayPointTransformationPair_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var pointPairs = []; - result = vision.ds.Matrix2D.PERSPECTIVE(pointPairs); - } catch (e) { - - } + var result = vision.ds.Matrix2D.PERSPECTIVE(pointPairs); - return { - testName: "vision.ds.Matrix2D.PERSPECTIVE", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.PERSPECTIVE", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.PERSPECTIVE", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__DEPTH_Float_Point2D_TransformationMatrix2D__ShouldWork():TestResult { - var result = null; try { var z = 0.0; var towards = new vision.ds.Point2D(0, 0); - result = vision.ds.Matrix2D.DEPTH(z, towards); - } catch (e) { - - } + var result = vision.ds.Matrix2D.DEPTH(z, towards); - return { - testName: "vision.ds.Matrix2D.DEPTH", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.DEPTH", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.DEPTH", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__createFilled_ArrayFloat_Matrix2D__ShouldWork():TestResult { - var result = null; try { var rows = []; - result = vision.ds.Matrix2D.createFilled(rows); - } catch (e) { - - } + var result = vision.ds.Matrix2D.createFilled(rows); - return { - testName: "vision.ds.Matrix2D.createFilled", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.createFilled", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.createFilled", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__createTransformation_ArrayFloat_ArrayFloat_ArrayFloat_Matrix2D__ShouldWork():TestResult { - var result = null; try { var xRow = []; var yRow = []; var homogeneousRow = []; - result = vision.ds.Matrix2D.createTransformation(xRow, yRow, homogeneousRow); - } catch (e) { - - } + var result = vision.ds.Matrix2D.createTransformation(xRow, yRow, homogeneousRow); - return { - testName: "vision.ds.Matrix2D.createTransformation", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.createTransformation", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.createTransformation", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__multiplyMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var a:Matrix2D = null; var b:Matrix2D = null; - result = vision.ds.Matrix2D.multiplyMatrices(a, b); - } catch (e) { - - } + var result = vision.ds.Matrix2D.multiplyMatrices(a, b); - return { - testName: "vision.ds.Matrix2D.multiplyMatrices", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.multiplyMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.multiplyMatrices", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__addMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var a:Matrix2D = null; var b:Matrix2D = null; - result = vision.ds.Matrix2D.addMatrices(a, b); - } catch (e) { - - } + var result = vision.ds.Matrix2D.addMatrices(a, b); - return { - testName: "vision.ds.Matrix2D.addMatrices", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.addMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.addMatrices", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__subtractMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var a:Matrix2D = null; var b:Matrix2D = null; - result = vision.ds.Matrix2D.subtractMatrices(a, b); - } catch (e) { - - } + var result = vision.ds.Matrix2D.subtractMatrices(a, b); - return { - testName: "vision.ds.Matrix2D.subtractMatrices", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.subtractMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.subtractMatrices", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__divideMatrices_Matrix2D_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var a:Matrix2D = null; var b:Matrix2D = null; - result = vision.ds.Matrix2D.divideMatrices(a, b); - } catch (e) { - - } + var result = vision.ds.Matrix2D.divideMatrices(a, b); - return { - testName: "vision.ds.Matrix2D.divideMatrices", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D.divideMatrices", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D.divideMatrices", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__invert__Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.invert(); - } catch (e) { + var result = object.invert(); - } - - return { - testName: "vision.ds.Matrix2D#invert", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#invert", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#invert", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getDeterminant__Float__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getDeterminant(); - } catch (e) { + var result = object.getDeterminant(); - } - - return { - testName: "vision.ds.Matrix2D#getDeterminant", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getDeterminant", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getDeterminant", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getTrace__Float__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getTrace(); - } catch (e) { + var result = object.getTrace(); - } - - return { - testName: "vision.ds.Matrix2D#getTrace", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getTrace", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getTrace", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getAverage__Float__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getAverage(); - } catch (e) { + var result = object.getAverage(); - } - - return { - testName: "vision.ds.Matrix2D#getAverage", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getAverage", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getAverage", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__multiplyWithScalar_Float_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -431,42 +514,50 @@ class Matrix2DTests { var scalar = 0.0; var object = new vision.ds.Matrix2D(width, height); - result = object.multiplyWithScalar(scalar); - } catch (e) { + var result = object.multiplyWithScalar(scalar); - } - - return { - testName: "vision.ds.Matrix2D#multiplyWithScalar", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#multiplyWithScalar", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#multiplyWithScalar", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__clone__Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.clone(); - } catch (e) { + var result = object.clone(); - } - - return { - testName: "vision.ds.Matrix2D#clone", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#clone", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#clone", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__map_FloatFloat_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -474,21 +565,25 @@ class Matrix2DTests { var mappingFunction = (_) -> null; var object = new vision.ds.Matrix2D(width, height); - result = object.map(mappingFunction); - } catch (e) { + var result = object.map(mappingFunction); - } - - return { - testName: "vision.ds.Matrix2D#map", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#map", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#map", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getSubMatrix_Int_Int_Int_Int_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -499,21 +594,25 @@ class Matrix2DTests { var toY = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getSubMatrix(fromX, fromY, toX, toY); - } catch (e) { + var result = object.getSubMatrix(fromX, fromY, toX, toY); - } - - return { - testName: "vision.ds.Matrix2D#getSubMatrix", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getSubMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getSubMatrix", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getColumn_Int_ArrayFloat__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -521,21 +620,25 @@ class Matrix2DTests { var x = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getColumn(x); - } catch (e) { + var result = object.getColumn(x); - } - - return { - testName: "vision.ds.Matrix2D#getColumn", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getColumn", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getColumn", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__getRow_Int_ArrayFloat__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -543,21 +646,25 @@ class Matrix2DTests { var y = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.getRow(y); - } catch (e) { + var result = object.getRow(y); - } - - return { - testName: "vision.ds.Matrix2D#getRow", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#getRow", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#getRow", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__setColumn__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -567,20 +674,24 @@ class Matrix2DTests { var object = new vision.ds.Matrix2D(width, height); object.setColumn(x, arr); - } catch (e) { - } - - return { - testName: "vision.ds.Matrix2D#setColumn", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#setColumn", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#setColumn", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__setRow__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -590,20 +701,24 @@ class Matrix2DTests { var object = new vision.ds.Matrix2D(width, height); object.setRow(y, arr); - } catch (e) { - } - - return { - testName: "vision.ds.Matrix2D#setRow", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#setRow", + returned: null, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#setRow", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__insertColumn_Int_ArrayFloat_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -612,21 +727,25 @@ class Matrix2DTests { var arr = []; var object = new vision.ds.Matrix2D(width, height); - result = object.insertColumn(x, arr); - } catch (e) { + var result = object.insertColumn(x, arr); - } - - return { - testName: "vision.ds.Matrix2D#insertColumn", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#insertColumn", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#insertColumn", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__insertRow_Int_ArrayFloat_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -635,21 +754,25 @@ class Matrix2DTests { var arr = []; var object = new vision.ds.Matrix2D(width, height); - result = object.insertRow(y, arr); - } catch (e) { + var result = object.insertRow(y, arr); - } - - return { - testName: "vision.ds.Matrix2D#insertRow", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#insertRow", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#insertRow", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__removeColumn_Int_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -657,21 +780,25 @@ class Matrix2DTests { var x = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.removeColumn(x); - } catch (e) { + var result = object.removeColumn(x); - } - - return { - testName: "vision.ds.Matrix2D#removeColumn", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#removeColumn", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#removeColumn", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__removeRow_Int_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -679,21 +806,25 @@ class Matrix2DTests { var y = 0; var object = new vision.ds.Matrix2D(width, height); - result = object.removeRow(y); - } catch (e) { + var result = object.removeRow(y); - } - - return { - testName: "vision.ds.Matrix2D#removeRow", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#removeRow", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#removeRow", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__toString_Int_Bool_String__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -702,21 +833,25 @@ class Matrix2DTests { var pretty = false; var object = new vision.ds.Matrix2D(width, height); - result = object.toString(precision, pretty); - } catch (e) { + var result = object.toString(precision, pretty); - } - - return { - testName: "vision.ds.Matrix2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__multiply_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -724,21 +859,25 @@ class Matrix2DTests { var b:Matrix2D = null; var object = new vision.ds.Matrix2D(width, height); - result = object.multiply(b); - } catch (e) { + var result = object.multiply(b); - } - - return { - testName: "vision.ds.Matrix2D#multiply", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#multiply", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#multiply", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__add_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -746,21 +885,25 @@ class Matrix2DTests { var b:Matrix2D = null; var object = new vision.ds.Matrix2D(width, height); - result = object.add(b); - } catch (e) { + var result = object.add(b); - } - - return { - testName: "vision.ds.Matrix2D#add", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#add", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#add", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__subtract_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -768,21 +911,25 @@ class Matrix2DTests { var b:Matrix2D = null; var object = new vision.ds.Matrix2D(width, height); - result = object.subtract(b); - } catch (e) { + var result = object.subtract(b); - } - - return { - testName: "vision.ds.Matrix2D#subtract", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Matrix2D#subtract", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#subtract", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Matrix2D__divide_Matrix2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var width = 0; var height = 0; @@ -790,16 +937,21 @@ class Matrix2DTests { var b:Matrix2D = null; var object = new vision.ds.Matrix2D(width, height); - result = object.divide(b); - } catch (e) { - - } - - return { - testName: "vision.ds.Matrix2D#divide", - returned: result, - expected: null, - status: Unimplemented + var result = object.divide(b); + + return { + testName: "vision.ds.Matrix2D#divide", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Matrix2D#divide", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/PerspectiveWarpTests.hx b/tests/generated/src/tests/PerspectiveWarpTests.hx index 92df8b98..8c4c3ffa 100644 --- a/tests/generated/src/tests/PerspectiveWarpTests.hx +++ b/tests/generated/src/tests/PerspectiveWarpTests.hx @@ -10,21 +10,25 @@ import vision.ds.Point2D; @:access(vision.algorithms.PerspectiveWarp) class PerspectiveWarpTests { public static function vision_algorithms_PerspectiveWarp__generateMatrix_ArrayPoint2D_ArrayPoint2D_Matrix2D__ShouldWork():TestResult { - var result = null; try { var destinationPoints = []; var sourcePoints = []; - result = vision.algorithms.PerspectiveWarp.generateMatrix(destinationPoints, sourcePoints); - } catch (e) { - - } + var result = vision.algorithms.PerspectiveWarp.generateMatrix(destinationPoints, sourcePoints); - return { - testName: "vision.algorithms.PerspectiveWarp.generateMatrix", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.PerspectiveWarp.generateMatrix", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.PerspectiveWarp.generateMatrix", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/PerwittTests.hx b/tests/generated/src/tests/PerwittTests.hx index d18d9e52..96a64b2e 100644 --- a/tests/generated/src/tests/PerwittTests.hx +++ b/tests/generated/src/tests/PerwittTests.hx @@ -11,39 +11,47 @@ import vision.ds.Image; @:access(vision.algorithms.Perwitt) class PerwittTests { public static function vision_algorithms_Perwitt__convolveWithPerwittOperator_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.algorithms.Perwitt.convolveWithPerwittOperator(image); + var result = vision.algorithms.Perwitt.convolveWithPerwittOperator(image); + + return { + testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Perwitt.convolveWithPerwittOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Perwitt__detectEdges_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0.0; - result = vision.algorithms.Perwitt.detectEdges(image, threshold); + var result = vision.algorithms.Perwitt.detectEdges(image, threshold); + + return { + testName: "vision.algorithms.Perwitt.detectEdges", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Perwitt.detectEdges", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Perwitt.detectEdges", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx index 41cb747f..6638e360 100644 --- a/tests/generated/src/tests/Point2DTests.hx +++ b/tests/generated/src/tests/Point2DTests.hx @@ -9,49 +9,56 @@ import vision.tools.MathTools; @:access(vision.ds.Point2D) class Point2DTests { public static function vision_ds_Point2D__toString__String__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; var object = new vision.ds.Point2D(x, y); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Point2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point2D__copy__Point2D__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; var object = new vision.ds.Point2D(x, y); - result = object.copy(); - } catch (e) { + var result = object.copy(); - } - - return { - testName: "vision.ds.Point2D#copy", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point2D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point2D#copy", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point2D__distanceTo_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -59,21 +66,25 @@ class Point2DTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.Point2D(x, y); - result = object.distanceTo(point); - } catch (e) { + var result = object.distanceTo(point); - } - - return { - testName: "vision.ds.Point2D#distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point2D#distanceTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point2D__degreesTo_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -81,21 +92,25 @@ class Point2DTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.Point2D(x, y); - result = object.degreesTo(point); - } catch (e) { + var result = object.degreesTo(point); - } - - return { - testName: "vision.ds.Point2D#degreesTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point2D#degreesTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point2D#degreesTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point2D__radiansTo_Point2D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -103,16 +118,21 @@ class Point2DTests { var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.Point2D(x, y); - result = object.radiansTo(point); - } catch (e) { + var result = object.radiansTo(point); - } - - return { - testName: "vision.ds.Point2D#radiansTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point2D#radiansTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point2D#radiansTo", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx index c24b718d..9cbaf677 100644 --- a/tests/generated/src/tests/Point3DTests.hx +++ b/tests/generated/src/tests/Point3DTests.hx @@ -9,7 +9,6 @@ import vision.tools.MathTools; @:access(vision.ds.Point3D) class Point3DTests { public static function vision_ds_Point3D__distanceTo_Point3D_Float__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -18,21 +17,25 @@ class Point3DTests { var point:Point3D = null; var object = new vision.ds.Point3D(x, y, z); - result = object.distanceTo(point); - } catch (e) { + var result = object.distanceTo(point); - } - - return { - testName: "vision.ds.Point3D#distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point3D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point3D#distanceTo", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point3D__copy__Point3D__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -40,21 +43,25 @@ class Point3DTests { var object = new vision.ds.Point3D(x, y, z); - result = object.copy(); - } catch (e) { + var result = object.copy(); - } - - return { - testName: "vision.ds.Point3D#copy", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point3D#copy", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point3D#copy", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Point3D__toString__String__ShouldWork():TestResult { - var result = null; try { var x = 0.0; var y = 0.0; @@ -62,16 +69,21 @@ class Point3DTests { var object = new vision.ds.Point3D(x, y, z); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Point3D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Point3D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Point3D#toString", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/QueueCellTests.hx b/tests/generated/src/tests/QueueCellTests.hx index df6cd593..afcd33e1 100644 --- a/tests/generated/src/tests/QueueCellTests.hx +++ b/tests/generated/src/tests/QueueCellTests.hx @@ -9,7 +9,6 @@ import vision.ds.QueueCell; @:access(vision.ds.QueueCell) class QueueCellTests { public static function vision_ds_QueueCell__getValue__T__ShouldWork():TestResult { - var result = null; try { var value = 0; var next = new vision.ds.QueueCell(0, null, null); @@ -17,16 +16,21 @@ class QueueCellTests { var object = new vision.ds.QueueCell(value, next, previous); - result = object.getValue(); - } catch (e) { + var result = object.getValue(); - } - - return { - testName: "vision.ds.QueueCell#getValue", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.QueueCell#getValue", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.QueueCell#getValue", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/QueueTests.hx b/tests/generated/src/tests/QueueTests.hx index 4d550da4..0fb698b6 100644 --- a/tests/generated/src/tests/QueueTests.hx +++ b/tests/generated/src/tests/QueueTests.hx @@ -9,117 +9,141 @@ import vision.ds.Queue; @:access(vision.ds.Queue) class QueueTests { public static function vision_ds_Queue__last__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Queue(); - result = object.last; + var result = object.last; + + return { + testName: "vision.ds.Queue#last", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Queue#last", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#last", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Queue__iterator__IteratorT__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Queue(); - result = object.iterator(); - } catch (e) { + var result = object.iterator(); - } - - return { - testName: "vision.ds.Queue#iterator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#iterator", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Queue#iterator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Queue__dequeue__T__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Queue(); - result = object.dequeue(); - } catch (e) { + var result = object.dequeue(); - } - - return { - testName: "vision.ds.Queue#dequeue", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#dequeue", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Queue#dequeue", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Queue__enqueue_T_T__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Queue(); - result = object.enqueue(value); - } catch (e) { + var result = object.enqueue(value); - } - - return { - testName: "vision.ds.Queue#enqueue", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#enqueue", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Queue#enqueue", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Queue__has_T_Bool__ShouldWork():TestResult { - var result = null; try { var value = 0; var object = new vision.ds.Queue(); - result = object.has(value); - } catch (e) { + var result = object.has(value); - } - - return { - testName: "vision.ds.Queue#has", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#has", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Queue#has", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Queue__toString__String__ShouldWork():TestResult { - var result = null; try { var object = new vision.ds.Queue(); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.Queue#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Queue#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Queue#toString", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx index 0c8e9373..5b9ebc14 100644 --- a/tests/generated/src/tests/RadixTests.hx +++ b/tests/generated/src/tests/RadixTests.hx @@ -11,56 +11,68 @@ import haxe.Int64; @:access(vision.algorithms.Radix) class RadixTests { public static function vision_algorithms_Radix__sort_ArrayInt_ArrayInt__ShouldWork():TestResult { - var result = null; try { var main = []; - result = vision.algorithms.Radix.sort(main); - } catch (e) { - - } + var result = vision.algorithms.Radix.sort(main); - return { - testName: "vision.algorithms.Radix.sort", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Radix.sort", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Radix__sort_ArrayUInt_ArrayUInt__ShouldWork():TestResult { - var result = null; try { var main = []; - result = vision.algorithms.Radix.sort(main); - } catch (e) { - - } + var result = vision.algorithms.Radix.sort(main); - return { - testName: "vision.algorithms.Radix.sort", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Radix.sort", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Radix__sort_ArrayInt64_ArrayInt64__ShouldWork():TestResult { - var result = null; try { var main = []; - result = vision.algorithms.Radix.sort(main); - } catch (e) { - - } + var result = vision.algorithms.Radix.sort(main); - return { - testName: "vision.algorithms.Radix.sort", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Radix.sort", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.Radix.sort", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/Ray2DTests.hx b/tests/generated/src/tests/Ray2DTests.hx index 6c40788c..54f298dc 100644 --- a/tests/generated/src/tests/Ray2DTests.hx +++ b/tests/generated/src/tests/Ray2DTests.hx @@ -9,7 +9,6 @@ import vision.tools.MathTools; @:access(vision.ds.Ray2D) class Ray2DTests { public static function vision_ds_Ray2D__yIntercept__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -17,21 +16,25 @@ class Ray2DTests { var radians = 0.0; var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.yIntercept; + var result = object.yIntercept; + + return { + testName: "vision.ds.Ray2D#yIntercept", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Ray2D#yIntercept", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#yIntercept", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__xIntercept__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -39,40 +42,48 @@ class Ray2DTests { var radians = 0.0; var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.xIntercept; + var result = object.xIntercept; + + return { + testName: "vision.ds.Ray2D#xIntercept", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Ray2D#xIntercept", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#xIntercept", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__from2Points_Point2D_Point2D_Ray2D__ShouldWork():TestResult { - var result = null; try { var point1 = new vision.ds.Point2D(0, 0); var point2 = new vision.ds.Point2D(0, 0); - result = vision.ds.Ray2D.from2Points(point1, point2); + var result = vision.ds.Ray2D.from2Points(point1, point2); + + return { + testName: "vision.ds.Ray2D.from2Points", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.Ray2D.from2Points", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D.from2Points", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__getPointAtX_Float_Point2D__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -82,21 +93,25 @@ class Ray2DTests { var x = 0.0; var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.getPointAtX(x); - } catch (e) { + var result = object.getPointAtX(x); - } - - return { - testName: "vision.ds.Ray2D#getPointAtX", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#getPointAtX", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Ray2D#getPointAtX", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__getPointAtY_Float_Point2D__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -106,21 +121,25 @@ class Ray2DTests { var y = 0.0; var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.getPointAtY(y); - } catch (e) { + var result = object.getPointAtY(y); - } - - return { - testName: "vision.ds.Ray2D#getPointAtY", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#getPointAtY", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Ray2D#getPointAtY", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__intersect_Ray2D_Point2D__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -130,21 +149,25 @@ class Ray2DTests { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.intersect(ray); - } catch (e) { + var result = object.intersect(ray); - } - - return { - testName: "vision.ds.Ray2D#intersect", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#intersect", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Ray2D#intersect", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_Ray2D__distanceTo_Ray2D_Float__ShouldWork():TestResult { - var result = null; try { var point = new vision.ds.Point2D(0, 0); var m = 0.0; @@ -154,16 +177,21 @@ class Ray2DTests { var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var object = new vision.ds.Ray2D(point, m, degrees, radians); - result = object.distanceTo(ray); - } catch (e) { + var result = object.distanceTo(ray); - } - - return { - testName: "vision.ds.Ray2D#distanceTo", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.Ray2D#distanceTo", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.Ray2D#distanceTo", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/RobertsCrossTests.hx b/tests/generated/src/tests/RobertsCrossTests.hx index 3cc3e7ec..ac26b168 100644 --- a/tests/generated/src/tests/RobertsCrossTests.hx +++ b/tests/generated/src/tests/RobertsCrossTests.hx @@ -10,20 +10,24 @@ import vision.ds.Image; @:access(vision.algorithms.RobertsCross) class RobertsCrossTests { public static function vision_algorithms_RobertsCross__convolveWithRobertsCross_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.algorithms.RobertsCross.convolveWithRobertsCross(image); - } catch (e) { - - } + var result = vision.algorithms.RobertsCross.convolveWithRobertsCross(image); - return { - testName: "vision.algorithms.RobertsCross.convolveWithRobertsCross", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.RobertsCross.convolveWithRobertsCross", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.RobertsCross.convolveWithRobertsCross", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/SimpleHoughTests.hx b/tests/generated/src/tests/SimpleHoughTests.hx index ae7355a2..2a25887c 100644 --- a/tests/generated/src/tests/SimpleHoughTests.hx +++ b/tests/generated/src/tests/SimpleHoughTests.hx @@ -11,40 +11,48 @@ import vision.ds.Image; @:access(vision.algorithms.SimpleHough) class SimpleHoughTests { public static function vision_algorithms_SimpleHough__detectLines_Image_Int_ArrayRay2D__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0; - result = vision.algorithms.SimpleHough.detectLines(image, threshold); + var result = vision.algorithms.SimpleHough.detectLines(image, threshold); + + return { + testName: "vision.algorithms.SimpleHough.detectLines", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.SimpleHough.detectLines", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.SimpleHough.detectLines", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_SimpleHough__mapLines_Image_ArrayRay2D_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var rays = []; - result = vision.algorithms.SimpleHough.mapLines(image, rays); + var result = vision.algorithms.SimpleHough.mapLines(image, rays); + + return { + testName: "vision.algorithms.SimpleHough.mapLines", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.SimpleHough.mapLines", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.SimpleHough.mapLines", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/SimpleLineDetectorTests.hx b/tests/generated/src/tests/SimpleLineDetectorTests.hx index f629d9a5..4ed05fbf 100644 --- a/tests/generated/src/tests/SimpleLineDetectorTests.hx +++ b/tests/generated/src/tests/SimpleLineDetectorTests.hx @@ -13,7 +13,6 @@ import vision.ds.IntPoint2D; @:access(vision.algorithms.SimpleLineDetector) class SimpleLineDetectorTests { public static function vision_algorithms_SimpleLineDetector__findLineFromPoint_Image_Int16Point2D_Float_Bool_Bool_Line2D__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var point = new vision.ds.Int16Point2D(0, 0); @@ -21,55 +20,68 @@ class SimpleLineDetectorTests { var preferTTB = false; var preferRTL = false; - result = vision.algorithms.SimpleLineDetector.findLineFromPoint(image, point, minLineLength, preferTTB, preferRTL); - } catch (e) { - - } + var result = vision.algorithms.SimpleLineDetector.findLineFromPoint(image, point, minLineLength, preferTTB, preferRTL); - return { - testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.SimpleLineDetector.findLineFromPoint", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_SimpleLineDetector__lineCoveragePercentage_Image_Line2D_Float__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - result = vision.algorithms.SimpleLineDetector.lineCoveragePercentage(image, line); - } catch (e) { - - } + var result = vision.algorithms.SimpleLineDetector.lineCoveragePercentage(image, line); - return { - testName: "vision.algorithms.SimpleLineDetector.lineCoveragePercentage", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.SimpleLineDetector.lineCoveragePercentage", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.SimpleLineDetector.lineCoveragePercentage", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_SimpleLineDetector__correctLines_ArrayLine2D_Float_Float_ArrayLine2D__ShouldWork():TestResult { - var result = null; try { var lines = []; var distanceThreshold = 0.0; var degError = 0.0; - result = vision.algorithms.SimpleLineDetector.correctLines(lines, distanceThreshold, degError); - } catch (e) { - - } + var result = vision.algorithms.SimpleLineDetector.correctLines(lines, distanceThreshold, degError); - return { - testName: "vision.algorithms.SimpleLineDetector.correctLines", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.SimpleLineDetector.correctLines", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.algorithms.SimpleLineDetector.correctLines", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/SobelTests.hx b/tests/generated/src/tests/SobelTests.hx index cc496c3b..fe053e69 100644 --- a/tests/generated/src/tests/SobelTests.hx +++ b/tests/generated/src/tests/SobelTests.hx @@ -11,39 +11,47 @@ import vision.ds.Image; @:access(vision.algorithms.Sobel) class SobelTests { public static function vision_algorithms_Sobel__convolveWithSobelOperator_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.algorithms.Sobel.convolveWithSobelOperator(image); + var result = vision.algorithms.Sobel.convolveWithSobelOperator(image); + + return { + testName: "vision.algorithms.Sobel.convolveWithSobelOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Sobel.convolveWithSobelOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Sobel.convolveWithSobelOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_algorithms_Sobel__detectEdges_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0.0; - result = vision.algorithms.Sobel.detectEdges(image, threshold); + var result = vision.algorithms.Sobel.detectEdges(image, threshold); + + return { + testName: "vision.algorithms.Sobel.detectEdges", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.algorithms.Sobel.detectEdges", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.algorithms.Sobel.detectEdges", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/TransformationMatrix2DTests.hx b/tests/generated/src/tests/TransformationMatrix2DTests.hx index 86a2c36c..fb5f9937 100644 --- a/tests/generated/src/tests/TransformationMatrix2DTests.hx +++ b/tests/generated/src/tests/TransformationMatrix2DTests.hx @@ -10,215 +10,259 @@ import vision.ds.Point3D; @:access(vision.ds.TransformationMatrix2D) class TransformationMatrix2DTests { public static function vision_ds_TransformationMatrix2D__underlying__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.underlying; + var result = object.underlying; + + return { + testName: "vision.ds.TransformationMatrix2D#underlying", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#underlying", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#underlying", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__a__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.a; + var result = object.a; + + return { + testName: "vision.ds.TransformationMatrix2D#a", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#a", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#a", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__b__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.b; + var result = object.b; + + return { + testName: "vision.ds.TransformationMatrix2D#b", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#b", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#b", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__c__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.c; + var result = object.c; + + return { + testName: "vision.ds.TransformationMatrix2D#c", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#c", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#c", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__d__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.d; + var result = object.d; + + return { + testName: "vision.ds.TransformationMatrix2D#d", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#d", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#d", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__e__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.e; + var result = object.e; + + return { + testName: "vision.ds.TransformationMatrix2D#e", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#e", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#e", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__f__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.f; + var result = object.f; + + return { + testName: "vision.ds.TransformationMatrix2D#f", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#f", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#f", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__tx__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.tx; + var result = object.tx; + + return { + testName: "vision.ds.TransformationMatrix2D#tx", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#tx", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#tx", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__ty__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.ty; + var result = object.ty; + + return { + testName: "vision.ds.TransformationMatrix2D#ty", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.TransformationMatrix2D#ty", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#ty", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__transformPoint_Point3D_Point3D__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var point:Point3D = null; var object = new vision.ds.TransformationMatrix2D(m); - result = object.transformPoint(point); - } catch (e) { + var result = object.transformPoint(point); - } - - return { - testName: "vision.ds.TransformationMatrix2D#transformPoint", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_TransformationMatrix2D__transformPoint_Point2D_Point2D__ShouldWork():TestResult { - var result = null; try { var m:Matrix2D = null; var point = new vision.ds.Point2D(0, 0); var object = new vision.ds.TransformationMatrix2D(m); - result = object.transformPoint(point); - } catch (e) { + var result = object.transformPoint(point); - } - - return { - testName: "vision.ds.TransformationMatrix2D#transformPoint", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.TransformationMatrix2D#transformPoint", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx index 98240e24..0f408297 100644 --- a/tests/generated/src/tests/UInt16Point2DTests.hx +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -9,126 +9,150 @@ import vision.ds.UInt16Point2D; @:access(vision.ds.UInt16Point2D) class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__x__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.x; + var result = object.x; + + return { + testName: "vision.ds.UInt16Point2D#x", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.UInt16Point2D#x", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#x", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_UInt16Point2D__y__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.y; + var result = object.y; + + return { + testName: "vision.ds.UInt16Point2D#y", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.ds.UInt16Point2D#y", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#y", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_UInt16Point2D__toString__String__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.toString(); - } catch (e) { + var result = object.toString(); - } - - return { - testName: "vision.ds.UInt16Point2D#toString", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#toString", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.UInt16Point2D#toString", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_UInt16Point2D__toPoint2D__Point2D__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.toPoint2D(); - } catch (e) { + var result = object.toPoint2D(); - } - - return { - testName: "vision.ds.UInt16Point2D#toPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#toPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.UInt16Point2D#toPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_UInt16Point2D__toIntPoint2D__Point2D__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.toIntPoint2D(); - } catch (e) { + var result = object.toIntPoint2D(); - } - - return { - testName: "vision.ds.UInt16Point2D#toIntPoint2D", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#toIntPoint2D", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.UInt16Point2D#toIntPoint2D", + returned: e, + expected: null, + status: Failure + } } } public static function vision_ds_UInt16Point2D__toInt__Int__ShouldWork():TestResult { - var result = null; try { var X = 0; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); - result = object.toInt(); - } catch (e) { + var result = object.toInt(); - } - - return { - testName: "vision.ds.UInt16Point2D#toInt", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.ds.UInt16Point2D#toInt", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "vision.ds.UInt16Point2D#toInt", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/VisionTests.hx b/tests/generated/src/tests/VisionTests.hx index 678541fc..b08b63a5 100644 --- a/tests/generated/src/tests/VisionTests.hx +++ b/tests/generated/src/tests/VisionTests.hx @@ -52,140 +52,167 @@ import vision.tools.MathTools.*; @:access(vision.Vision) class VisionTests { public static function vision_Vision__combine_Image_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var with = new vision.ds.Image(100, 100); var percentage = 0.0; - result = vision.Vision.combine(image, with, percentage); + var result = vision.Vision.combine(image, with, percentage); + + return { + testName: "vision.Vision.combine", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.combine", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.combine", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__tint_Image_Color_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var withColor:Color = null; var percentage = 0.0; - result = vision.Vision.tint(image, withColor, percentage); + var result = vision.Vision.tint(image, withColor, percentage); + + return { + testName: "vision.Vision.tint", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.tint", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.tint", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__grayscale_Image_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var simpleGrayscale = false; - result = vision.Vision.grayscale(image, simpleGrayscale); + var result = vision.Vision.grayscale(image, simpleGrayscale); + + return { + testName: "vision.Vision.grayscale", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.grayscale", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.grayscale", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__invert_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.invert(image); + var result = vision.Vision.invert(image); + + return { + testName: "vision.Vision.invert", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.invert", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.invert", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__sepia_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; - result = vision.Vision.sepia(image, strength); + var result = vision.Vision.sepia(image, strength); + + return { + testName: "vision.Vision.sepia", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.sepia", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.sepia", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__blackAndWhite_Image_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0; - result = vision.Vision.blackAndWhite(image, threshold); + var result = vision.Vision.blackAndWhite(image, threshold); + + return { + testName: "vision.Vision.blackAndWhite", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.blackAndWhite", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.blackAndWhite", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__contrast_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.contrast(image); + var result = vision.Vision.contrast(image); + + return { + testName: "vision.Vision.contrast", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.contrast", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.contrast", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__smooth_Image_Float_Bool_Int_Bool_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; @@ -194,99 +221,119 @@ class VisionTests { var circularKernel = false; var iterations = 0; - result = vision.Vision.smooth(image, strength, affectAlpha, kernelRadius, circularKernel, iterations); + var result = vision.Vision.smooth(image, strength, affectAlpha, kernelRadius, circularKernel, iterations); + + return { + testName: "vision.Vision.smooth", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.smooth", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.smooth", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__pixelate_Image_Bool_Int_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var averagePixels = false; var pixelSize = 0; var affectAlpha = false; - result = vision.Vision.pixelate(image, averagePixels, pixelSize, affectAlpha); + var result = vision.Vision.pixelate(image, averagePixels, pixelSize, affectAlpha); + + return { + testName: "vision.Vision.pixelate", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.pixelate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.pixelate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__posterize_Image_Int_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var bitsPerChannel = 0; var affectAlpha = false; - result = vision.Vision.posterize(image, bitsPerChannel, affectAlpha); + var result = vision.Vision.posterize(image, bitsPerChannel, affectAlpha); + + return { + testName: "vision.Vision.posterize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.posterize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.posterize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__sharpen_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.sharpen(image); + var result = vision.Vision.sharpen(image); + + return { + testName: "vision.Vision.sharpen", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.sharpen", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.sharpen", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__deepfry_Image_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var iterations = 0; - result = vision.Vision.deepfry(image, iterations); + var result = vision.Vision.deepfry(image, iterations); + + return { + testName: "vision.Vision.deepfry", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.deepfry", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.deepfry", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__vignette_Image_Float_Float_Bool_Color_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; @@ -294,295 +341,355 @@ class VisionTests { var ratioDependent = false; var color:Color = null; - result = vision.Vision.vignette(image, strength, intensity, ratioDependent, color); + var result = vision.Vision.vignette(image, strength, intensity, ratioDependent, color); + + return { + testName: "vision.Vision.vignette", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.vignette", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.vignette", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__fisheyeDistortion_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; - result = vision.Vision.fisheyeDistortion(image, strength); + var result = vision.Vision.fisheyeDistortion(image, strength); + + return { + testName: "vision.Vision.fisheyeDistortion", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.fisheyeDistortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.fisheyeDistortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__barrelDistortion_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; - result = vision.Vision.barrelDistortion(image, strength); + var result = vision.Vision.barrelDistortion(image, strength); + + return { + testName: "vision.Vision.barrelDistortion", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.barrelDistortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.barrelDistortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__pincushionDistortion_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var strength = 0.0; - result = vision.Vision.pincushionDistortion(image, strength); + var result = vision.Vision.pincushionDistortion(image, strength); + + return { + testName: "vision.Vision.pincushionDistortion", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.pincushionDistortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.pincushionDistortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__mustacheDistortion_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var amplitude = 0.0; - result = vision.Vision.mustacheDistortion(image, amplitude); + var result = vision.Vision.mustacheDistortion(image, amplitude); + + return { + testName: "vision.Vision.mustacheDistortion", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.mustacheDistortion", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.mustacheDistortion", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__dilate_Image_Int_ColorImportanceOrder_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var dilationRadius = 0; var colorImportanceOrder:ColorImportanceOrder = null; var circularKernel = false; - result = vision.Vision.dilate(image, dilationRadius, colorImportanceOrder, circularKernel); + var result = vision.Vision.dilate(image, dilationRadius, colorImportanceOrder, circularKernel); + + return { + testName: "vision.Vision.dilate", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.dilate", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.dilate", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__erode_Image_Int_ColorImportanceOrder_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var erosionRadius = 0; var colorImportanceOrder:ColorImportanceOrder = null; var circularKernel = false; - result = vision.Vision.erode(image, erosionRadius, colorImportanceOrder, circularKernel); + var result = vision.Vision.erode(image, erosionRadius, colorImportanceOrder, circularKernel); + + return { + testName: "vision.Vision.erode", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.erode", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.erode", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__saltAndPepperNoise_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var percentage = 0.0; - result = vision.Vision.saltAndPepperNoise(image, percentage); + var result = vision.Vision.saltAndPepperNoise(image, percentage); + + return { + testName: "vision.Vision.saltAndPepperNoise", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.saltAndPepperNoise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.saltAndPepperNoise", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__dropOutNoise_Image_Float_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var percentage = 0.0; var threshold = 0; - result = vision.Vision.dropOutNoise(image, percentage, threshold); + var result = vision.Vision.dropOutNoise(image, percentage, threshold); + + return { + testName: "vision.Vision.dropOutNoise", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.dropOutNoise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.dropOutNoise", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__whiteNoise_Image_Float_WhiteNoiseRange_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var percentage = 0.0; var whiteNoiseRange:WhiteNoiseRange = null; - result = vision.Vision.whiteNoise(image, percentage, whiteNoiseRange); + var result = vision.Vision.whiteNoise(image, percentage, whiteNoiseRange); + + return { + testName: "vision.Vision.whiteNoise", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.whiteNoise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.whiteNoise", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__normalize_Image_Color_Color_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var rangeStart:Color = null; var rangeEnd:Color = null; - result = vision.Vision.normalize(image, rangeStart, rangeEnd); + var result = vision.Vision.normalize(image, rangeStart, rangeEnd); + + return { + testName: "vision.Vision.normalize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.normalize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.normalize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__limitColorRanges_Image_Color_Color_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var rangeStart:Color = null; var rangeEnd:Color = null; - result = vision.Vision.limitColorRanges(image, rangeStart, rangeEnd); + var result = vision.Vision.limitColorRanges(image, rangeStart, rangeEnd); + + return { + testName: "vision.Vision.limitColorRanges", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.limitColorRanges", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.limitColorRanges", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__replaceColorRanges_Image_ArrayrangeStartColorrangeEndColorreplacementColor_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var ranges = []; - result = vision.Vision.replaceColorRanges(image, ranges); + var result = vision.Vision.replaceColorRanges(image, ranges); + + return { + testName: "vision.Vision.replaceColorRanges", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.replaceColorRanges", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.replaceColorRanges", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__filterForColorChannel_Image_ColorChannel_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var channel:ColorChannel = null; - result = vision.Vision.filterForColorChannel(image, channel); + var result = vision.Vision.filterForColorChannel(image, channel); + + return { + testName: "vision.Vision.filterForColorChannel", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.filterForColorChannel", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.filterForColorChannel", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__convolve_Image_EitherTypeKernel2DArrayArrayFloat_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var kernel:EitherType>> = null; - result = vision.Vision.convolve(image, kernel); + var result = vision.Vision.convolve(image, kernel); + + return { + testName: "vision.Vision.convolve", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.convolve", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.convolve", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__affineTransform_Image_TransformationMatrix2D_ImageExpansionMode_Point2D_TransformationMatrixOrigination_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var matrix:TransformationMatrix2D = null; @@ -590,194 +697,234 @@ class VisionTests { var originPoint = new vision.ds.Point2D(0, 0); var originMode:TransformationMatrixOrigination = null; - result = vision.Vision.affineTransform(image, matrix, expansionMode, originPoint, originMode); + var result = vision.Vision.affineTransform(image, matrix, expansionMode, originPoint, originMode); + + return { + testName: "vision.Vision.affineTransform", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.affineTransform", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.affineTransform", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__projectiveTransform_Image_TransformationMatrix2D_ImageExpansionMode_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var matrix:TransformationMatrix2D = null; var expansionMode:ImageExpansionMode = null; - result = vision.Vision.projectiveTransform(image, matrix, expansionMode); + var result = vision.Vision.projectiveTransform(image, matrix, expansionMode); + + return { + testName: "vision.Vision.projectiveTransform", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.projectiveTransform", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.projectiveTransform", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__nearestNeighborBlur_Image_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var iterations = 0; - result = vision.Vision.nearestNeighborBlur(image, iterations); + var result = vision.Vision.nearestNeighborBlur(image, iterations); + + return { + testName: "vision.Vision.nearestNeighborBlur", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.nearestNeighborBlur", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.nearestNeighborBlur", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__gaussianBlur_Image_Float_GaussianKernelSize_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var sigma = 0.0; var kernelSize:GaussianKernelSize = null; var fast = false; - result = vision.Vision.gaussianBlur(image, sigma, kernelSize, fast); + var result = vision.Vision.gaussianBlur(image, sigma, kernelSize, fast); + + return { + testName: "vision.Vision.gaussianBlur", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.gaussianBlur", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.gaussianBlur", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__medianBlur_Image_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var kernelSize = 0; - result = vision.Vision.medianBlur(image, kernelSize); + var result = vision.Vision.medianBlur(image, kernelSize); + + return { + testName: "vision.Vision.medianBlur", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.medianBlur", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.medianBlur", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__simpleLine2DDetection_Image_Float_Float_AlgorithmSettings_ArrayLine2D__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var accuracy = 0.0; var minLineLength = 0.0; var speedToAccuracyRatio:AlgorithmSettings = null; - result = vision.Vision.simpleLine2DDetection(image, accuracy, minLineLength, speedToAccuracyRatio); + var result = vision.Vision.simpleLine2DDetection(image, accuracy, minLineLength, speedToAccuracyRatio); + + return { + testName: "vision.Vision.simpleLine2DDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.simpleLine2DDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.simpleLine2DDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__sobelEdgeDiffOperator_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.sobelEdgeDiffOperator(image); + var result = vision.Vision.sobelEdgeDiffOperator(image); + + return { + testName: "vision.Vision.sobelEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.sobelEdgeDiffOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.sobelEdgeDiffOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__perwittEdgeDiffOperator_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.perwittEdgeDiffOperator(image); + var result = vision.Vision.perwittEdgeDiffOperator(image); + + return { + testName: "vision.Vision.perwittEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.perwittEdgeDiffOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.perwittEdgeDiffOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__robertEdgeDiffOperator_Image_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); - result = vision.Vision.robertEdgeDiffOperator(image); + var result = vision.Vision.robertEdgeDiffOperator(image); + + return { + testName: "vision.Vision.robertEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.robertEdgeDiffOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.robertEdgeDiffOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__laplacianEdgeDiffOperator_Image_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var filterPositive = false; - result = vision.Vision.laplacianEdgeDiffOperator(image, filterPositive); + var result = vision.Vision.laplacianEdgeDiffOperator(image, filterPositive); + + return { + testName: "vision.Vision.laplacianEdgeDiffOperator", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.laplacianEdgeDiffOperator", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.laplacianEdgeDiffOperator", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__cannyEdgeDetection_Image_Float_GaussianKernelSize_Float_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var sigma = 0.0; @@ -785,59 +932,71 @@ class VisionTests { var lowThreshold = 0.0; var highThreshold = 0.0; - result = vision.Vision.cannyEdgeDetection(image, sigma, kernelSize, lowThreshold, highThreshold); + var result = vision.Vision.cannyEdgeDetection(image, sigma, kernelSize, lowThreshold, highThreshold); + + return { + testName: "vision.Vision.cannyEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.cannyEdgeDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.cannyEdgeDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__sobelEdgeDetection_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0.0; - result = vision.Vision.sobelEdgeDetection(image, threshold); + var result = vision.Vision.sobelEdgeDetection(image, threshold); + + return { + testName: "vision.Vision.sobelEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.sobelEdgeDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.sobelEdgeDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__perwittEdgeDetection_Image_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0.0; - result = vision.Vision.perwittEdgeDetection(image, threshold); + var result = vision.Vision.perwittEdgeDetection(image, threshold); + + return { + testName: "vision.Vision.perwittEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.perwittEdgeDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.perwittEdgeDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__laplacianOfGaussianEdgeDetection_Image_Int_Bool_Float_GaussianKernelSize_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var threshold = 0; @@ -845,116 +1004,141 @@ class VisionTests { var sigma = 0.0; var kernelSize:GaussianKernelSize = null; - result = vision.Vision.laplacianOfGaussianEdgeDetection(image, threshold, filterPositive, sigma, kernelSize); + var result = vision.Vision.laplacianOfGaussianEdgeDetection(image, threshold, filterPositive, sigma, kernelSize); + + return { + testName: "vision.Vision.laplacianOfGaussianEdgeDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.laplacianOfGaussianEdgeDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.laplacianOfGaussianEdgeDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__convolutionRidgeDetection_Image_Color_Color_Bool_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var normalizationRangeStart:Color = null; var normalizationRangeEnd:Color = null; var refine = false; - result = vision.Vision.convolutionRidgeDetection(image, normalizationRangeStart, normalizationRangeEnd, refine); + var result = vision.Vision.convolutionRidgeDetection(image, normalizationRangeStart, normalizationRangeEnd, refine); + + return { + testName: "vision.Vision.convolutionRidgeDetection", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.convolutionRidgeDetection", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.convolutionRidgeDetection", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__bilateralDenoise_Image_Float_Float_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var gaussianSigma = 0.0; var intensitySigma = 0.0; - result = vision.Vision.bilateralDenoise(image, gaussianSigma, intensitySigma); + var result = vision.Vision.bilateralDenoise(image, gaussianSigma, intensitySigma); + + return { + testName: "vision.Vision.bilateralDenoise", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.bilateralDenoise", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.bilateralDenoise", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__simpleImageSimilarity_Image_Image_SimilarityScoringMechanism_Float__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var compared = new vision.ds.Image(100, 100); var scoringMechanism:SimilarityScoringMechanism = null; - result = vision.Vision.simpleImageSimilarity(image, compared, scoringMechanism); + var result = vision.Vision.simpleImageSimilarity(image, compared, scoringMechanism); + + return { + testName: "vision.Vision.simpleImageSimilarity", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.simpleImageSimilarity", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.simpleImageSimilarity", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__kmeansPosterize_Image_Int_Image__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var maxColorCount = 0; - result = vision.Vision.kmeansPosterize(image, maxColorCount); + var result = vision.Vision.kmeansPosterize(image, maxColorCount); + + return { + testName: "vision.Vision.kmeansPosterize", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.kmeansPosterize", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.kmeansPosterize", + returned: e, + expected: null, + status: Failure + } } } public static function vision_Vision__kmeansGroupImageColors_Image_Int_Bool_ArrayColorCluster__ShouldWork():TestResult { - var result = null; try { var image = new vision.ds.Image(100, 100); var groupCount = 0; var considerTransparency = false; - result = vision.Vision.kmeansGroupImageColors(image, groupCount, considerTransparency); + var result = vision.Vision.kmeansGroupImageColors(image, groupCount, considerTransparency); + + return { + testName: "vision.Vision.kmeansGroupImageColors", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.Vision.kmeansGroupImageColors", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.Vision.kmeansGroupImageColors", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generated/src/tests/VisionThreadTests.hx b/tests/generated/src/tests/VisionThreadTests.hx index 094ce190..f322901e 100644 --- a/tests/generated/src/tests/VisionThreadTests.hx +++ b/tests/generated/src/tests/VisionThreadTests.hx @@ -10,40 +10,24 @@ import haxe.Exception; @:access(vision.helpers.VisionThread) class VisionThreadTests { public static function vision_helpers_VisionThread__create_VoidVoid_VisionThread__ShouldWork():TestResult { - var result = null; try { var job = () -> return; - result = vision.helpers.VisionThread.create(job); + var result = vision.helpers.VisionThread.create(job); + + return { + testName: "vision.helpers.VisionThread.create", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "vision.helpers.VisionThread.create", - returned: result, - expected: null, - status: Unimplemented - } - } - - public static function vision_helpers_VisionThread__start__ShouldWork():TestResult { - var result = null; - try { - var job = () -> return; - - - var object = new vision.helpers.VisionThread(job); - object.start(); - } catch (e) { - - } - - return { - testName: "vision.helpers.VisionThread#start", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "vision.helpers.VisionThread.create", + returned: e, + expected: null, + status: Failure + } } } diff --git a/tests/generator/Detector.hx b/tests/generator/Detector.hx index 8e903dac..1b762981 100644 --- a/tests/generator/Detector.hx +++ b/tests/generator/Detector.hx @@ -6,121 +6,131 @@ import sys.FileSystem; using StringTools; class Detector { - - static var packageFinder = ~/^package ([\w.]+)/m; - static var importFinder = ~/^import ([\w.*]+)/m; - static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; - static var staticFunctionFinder = ~/public static (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; - static var staticFieldFinder = ~/public static (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFieldFinder = ~/public (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; - static var instanceFunctionFinder = ~/public (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; - static var constructorFinder = ~/function new\s*\((.*)\)/; - - public static function detectOnFile(pathToHaxeFile:String):TestDetections { - var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); - var fileContent = File.getContent(pathToHaxeFile), originalFileContent = fileContent; - - packageFinder.match(fileContent); - var packageName = packageFinder.matched(1); - fileContent = packageFinder.matchedRight(); - - var imports = []; - while (importFinder.match(fileContent)) { - var classPath = importFinder.matched(1); - fileContent = importFinder.matchedRight(); - imports.push(classPath); + static var packageFinder = ~/^package ([\w.]+)/m; + static var importFinder = ~/^import ([\w.*]+)/m; + static var classNameFinder = ~/^(?:class|abstract) (\w+)/m; + static var staticFunctionFinder = ~/public static (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; + static var staticFieldFinder = ~/public static (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFieldFinder = ~/public (?:inline )?(?:var|final) (\w+)\(get, \w+\)/m; + static var instanceFunctionFinder = ~/public (?:inline )?function (\w+)(?:)?\((.*)\)(:.+\s*|\s*)\{/m; + static var constructorFinder = ~/function new\s*\((.*)\)/; + static var targetSpecificZoneFinder = ~/\t?#if .+?\n.+?\t?#end/gs; + static var endOfMainClassFinder = ~/\n}/; + static var commentFinder = ~/\/\/.+/g; + + public static function detectOnFile(pathToHaxeFile:String):TestDetections { + var pathToHaxeFile = FileSystem.absolutePath(pathToHaxeFile); + var fileContent = File.getContent(pathToHaxeFile), + originalFileContent = fileContent; + + packageFinder.match(fileContent); + var packageName = packageFinder.matched(1); + fileContent = packageFinder.matchedRight(); + + fileContent = targetSpecificZoneFinder.replace(fileContent, ""); + fileContent = commentFinder.replace(fileContent, ""); + + var imports = []; + while (importFinder.match(fileContent)) { + var classPath = importFinder.matched(1); + fileContent = importFinder.matchedRight(); + imports.push(classPath); + } + + if (!classNameFinder.match(fileContent)) { + return null; + } + + + var className = classNameFinder.matched(1); + fileContent = classNameFinder.matchedRight(); + + if (endOfMainClassFinder.match(fileContent)) { + fileContent = endOfMainClassFinder.matchedLeft(); } - if (!classNameFinder.match(fileContent)) { - return null; - } + originalFileContent = fileContent; - var className = classNameFinder.matched(1); - fileContent = classNameFinder.matchedRight(); + var staticFunctions = new Map<{name:String, type:String}, String>(); + while (staticFunctionFinder.match(fileContent)) { + var functionName = staticFunctionFinder.matched(1); + var functionParameters = staticFunctionFinder.matched(2); + var functionReturnType = staticFunctionFinder.matched(3).trim(); + if (functionReturnType == "") functionReturnType = "Void"; - originalFileContent = fileContent; + fileContent = staticFunctionFinder.matchedRight(); + staticFunctions.set({name: functionName, type: functionReturnType}, functionParameters); + } - var staticFunctions = new Map<{name:String, type:String}, String>(); - while (staticFunctionFinder.match(fileContent)) { - var functionName = staticFunctionFinder.matched(1); - var functionParameters = staticFunctionFinder.matched(2); - var functionReturnType = staticFunctionFinder.matched(3).trim(); - if (functionReturnType == "") functionReturnType = "Void"; - - fileContent = staticFunctionFinder.matchedRight(); + fileContent = originalFileContent; - staticFunctions.set({name: functionName, type: functionReturnType}, functionParameters); - } + var staticFields = []; + while (staticFieldFinder.match(fileContent)) { + var fieldName = staticFieldFinder.matched(1); + fileContent = staticFieldFinder.matchedRight(); - fileContent = originalFileContent; + staticFields.push(fieldName); + } - var staticFields = []; - while (staticFieldFinder.match(fileContent)) { - var fieldName = staticFieldFinder.matched(1); - fileContent = staticFieldFinder.matchedRight(); - - staticFields.push(fieldName); - } + fileContent = originalFileContent; - fileContent = originalFileContent; + var instanceFunctions = new Map<{name:String, type:String}, String>(); - var instanceFunctions = new Map<{name:String, type:String}, String>(); + while (instanceFunctionFinder.match(fileContent)) { + var functionName = instanceFunctionFinder.matched(1); + var functionParameters = instanceFunctionFinder.matched(2); + var functionReturnType = instanceFunctionFinder.matched(3).trim(); + if (functionReturnType == "") functionReturnType = "Void"; - while (instanceFunctionFinder.match(fileContent)) { - var functionName = instanceFunctionFinder.matched(1); - var functionParameters = instanceFunctionFinder.matched(2); - var functionReturnType = instanceFunctionFinder.matched(3).trim(); - if (functionReturnType == "") functionReturnType = "Void"; + fileContent = instanceFunctionFinder.matchedRight(); - fileContent = instanceFunctionFinder.matchedRight(); - - if (functionName == "new") { - continue; - } + if (functionName == "new") { + continue; + } - instanceFunctions.set({name: functionName, type: functionReturnType}, functionParameters); - } + instanceFunctions.set({name: functionName, type: functionReturnType}, functionParameters); + } - fileContent = originalFileContent; + fileContent = originalFileContent; - var instanceFields = []; - while (instanceFieldFinder.match(fileContent)) { - var fieldName = instanceFieldFinder.matched(1); - fileContent = instanceFieldFinder.matchedRight(); + var instanceFields = []; + while (instanceFieldFinder.match(fileContent)) { + var fieldName = instanceFieldFinder.matched(1); + fileContent = instanceFieldFinder.matchedRight(); - instanceFields.push(fieldName); - } + instanceFields.push(fieldName); + } - fileContent = originalFileContent; + fileContent = originalFileContent; - var constructorParameters = []; - while (constructorFinder.match(fileContent)) { - var parameters = constructorFinder.matched(1); - fileContent = constructorFinder.matchedRight(); - constructorParameters.push(parameters); - } + var constructorParameters = []; + while (constructorFinder.match(fileContent)) { + var parameters = constructorFinder.matched(1); + fileContent = constructorFinder.matchedRight(); + constructorParameters.push(parameters); + } - return { - packageName: packageName, - imports: imports, - className: className, - staticFunctions: staticFunctions, - staticFields: staticFields, - instanceFunctions: instanceFunctions, - instanceFields: instanceFields, - constructorParameters: constructorParameters - } - } + return { + packageName: packageName, + imports: imports, + className: className, + staticFunctions: staticFunctions, + staticFields: staticFields, + instanceFunctions: instanceFunctions, + instanceFields: instanceFields, + constructorParameters: constructorParameters + } + } } typedef TestDetections = { - packageName:String, - imports:Array, - className:String, - constructorParameters:Array, - staticFunctions:Map<{name:String, type:String}, String>, - staticFields:Array, - instanceFunctions:Map<{name:String, type:String}, String>, - instanceFields:Array -} \ No newline at end of file + packageName:String, + imports:Array, + className:String, + constructorParameters:Array, + staticFunctions:Map<{name:String, type:String}, String>, + staticFields:Array, + instanceFunctions:Map<{name:String, type:String}, String>, + instanceFields:Array +} diff --git a/tests/generator/Generator.hx b/tests/generator/Generator.hx index e564b4c0..45618bbf 100644 --- a/tests/generator/Generator.hx +++ b/tests/generator/Generator.hx @@ -101,9 +101,12 @@ class Generator { static function generateTest(template:String, testBase:TestBase):String { var cleanPackage = testBase.packageName.replace(".", "_") + '_${testBase.className}'; if (testBase.fieldType == "Void") { - template = template.replace("result = ", "").replace("var null", "var result = null"); + template = template.replace("var result = ", "").replace("returned: result", "returned: null"); } else if (testBase.fieldType != "") { template = template.replace("X2__", 'X2_${~/[^a-zA-Z0-9_]/g.replace('${testBase.parameters.types}_${testBase.fieldType}', "")}__'); + } + if (hasSpecialConstructor(testBase.className)) { + template = template.replace("new X4(X6)", generateSpecialConstructorFor(testBase.className, testBase.parameters.injection)); } return template .replace("X1", cleanPackage) @@ -184,6 +187,20 @@ class Generator { default: "null"; } } + + static function hasSpecialConstructor(className:String):Bool { + return switch className { + case "ImageView": true; + default: false; + } + } + + static function generateSpecialConstructorFor(className:String, parameterInjection:String):String { + return switch className { + case "ImageView": '({} : ImageView)'; + default: "new X4(X6)"; + } + } } typedef TestBase = { diff --git a/tests/generator/Main.hx b/tests/generator/Main.hx index 4b867338..f6561c96 100644 --- a/tests/generator/Main.hx +++ b/tests/generator/Main.hx @@ -1,6 +1,8 @@ package; import vision.ds.IntPoint2D; +import vision.ds.Array2D; +import vision.tools.ImageTools; import sys.io.File; import sys.FileSystem; diff --git a/tests/generator/templates/InstanceFieldTestTemplate.hx b/tests/generator/templates/InstanceFieldTestTemplate.hx index 3368edbe..b077f6a9 100644 --- a/tests/generator/templates/InstanceFieldTestTemplate.hx +++ b/tests/generator/templates/InstanceFieldTestTemplate.hx @@ -1,17 +1,21 @@ public static function X1__X2__X3():TestResult { - var result = null; try { X8 var object = new X4(X6); - result = object.X2; + var result = object.X2; + + return { + testName: "X4#X2", + returned: result, + expected: null, + status: Unimplemented + } } catch (e) { - - } - - return { - testName: "X4#X2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "X4#X2", + returned: e, + expected: null, + status: Failure + } } } \ No newline at end of file diff --git a/tests/generator/templates/InstanceFunctionTestTemplate.hx b/tests/generator/templates/InstanceFunctionTestTemplate.hx index 06fdf4e8..b786867f 100644 --- a/tests/generator/templates/InstanceFunctionTestTemplate.hx +++ b/tests/generator/templates/InstanceFunctionTestTemplate.hx @@ -1,18 +1,22 @@ public static function X1__X2__X3():TestResult { - var result = null; try { X8 X7 var object = new X4(X6); - result = object.X2(X5); - } catch (e) { + var result = object.X2(X5); - } - - return { - testName: "X4#X2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "X4#X2", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "X4#X2", + returned: e, + expected: null, + status: Failure + } } } \ No newline at end of file diff --git a/tests/generator/templates/StaticFieldTestTemplate.hx b/tests/generator/templates/StaticFieldTestTemplate.hx index 0c153ae3..21cbb6d8 100644 --- a/tests/generator/templates/StaticFieldTestTemplate.hx +++ b/tests/generator/templates/StaticFieldTestTemplate.hx @@ -1,15 +1,19 @@ public static function X1__X2__X3():TestResult { - var result = null; try { - result = X4.X2; - } catch (e) { - - } + var result = X4.X2; - return { - testName: "X4.X2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "X4.X2", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "X4.X2", + returned: e, + expected: null, + status: Failure + } } } \ No newline at end of file diff --git a/tests/generator/templates/StaticFunctionTestTemplate.hx b/tests/generator/templates/StaticFunctionTestTemplate.hx index eb6d9059..e4b5298d 100644 --- a/tests/generator/templates/StaticFunctionTestTemplate.hx +++ b/tests/generator/templates/StaticFunctionTestTemplate.hx @@ -1,16 +1,20 @@ public static function X1__X2__X3():TestResult { - var result = null; try { X7 - result = X4.X2(X5); - } catch (e) { - - } + var result = X4.X2(X5); - return { - testName: "X4.X2", - returned: result, - expected: null, - status: Unimplemented + return { + testName: "X4.X2", + returned: result, + expected: null, + status: Unimplemented + } + } catch (e) { + return { + testName: "X4.X2", + returned: e, + expected: null, + status: Failure + } } } \ No newline at end of file From 61eba74e75ae58de74149773b8b68ab213de8938 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:55:00 +0300 Subject: [PATCH 25/32] more unit tests, need to resolve stuff with byte array --- src/vision/ds/ByteArray.hx | 21 ++ tests/generated/src/Main.hx | 18 +- tests/generated/src/TestStatus.hx | 4 + tests/generated/src/tests/ByteArrayTests.hx | 216 +++++++++++--------- tests/tests.hxml | 7 + 5 files changed, 170 insertions(+), 96 deletions(-) create mode 100644 tests/tests.hxml diff --git a/src/vision/ds/ByteArray.hx b/src/vision/ds/ByteArray.hx index 66c9ac0a..b2eaf0a3 100644 --- a/src/vision/ds/ByteArray.hx +++ b/src/vision/ds/ByteArray.hx @@ -70,6 +70,27 @@ abstract ByteArray(Bytes) from Bytes to Bytes { return Bytes.ofString(Serializer.run(value)); } + /** + * Takes an array of numbers of any type, and turns it into a byte array. + * @param value An array of UInts/Ints + * @param itemSize The amount of bytes to capture from each item. Default is `1`, which captures only the first byte + */ + overload extern public static inline function from(value:Array, itemSize:Int = 1) { + var bytes = new ByteArray(value.length * itemSize); + var bytesIndex = 0; + var itemIndex = 0; + while (bytesIndex < bytes.length) { + var sizeCounter = 0; + var item = value[itemIndex++]; + while (sizeCounter < itemSize) { + bytes.set(bytesIndex + sizeCounter, item & Math.round(Math.pow(2, sizeCounter * 8) - 1)); + sizeCounter++; + } + bytesIndex += itemSize; + } + return bytes; + } + /** Reads a byte at the specified index **/ diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 1ae77065..ba42ae52 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -1,8 +1,11 @@ package; -import haxe.macro.Expr.Constant; +import vision.ds.ByteArray; +import haxe.io.Bytes; import tests.*; +using vision.tools.ArrayTools; + import TestStatus; import TestResult; import TestConclusion; @@ -45,8 +48,8 @@ class Main { Sys.println('$CYAN$BOLD Unit Test $i:$RESET $BOLD$ITALIC${getTestPassColor(result.status)}${result.testName}$RESET'); Sys.println(' - $RESET$BOLD$WHITE Result: $ITALIC${getTestPassColor(result.status)}${result.status}$RESET'); if (result.status == Failure) { - Sys.println(' - $RESET$BOLD$WHITE Expected:$RESET $ITALIC$GREEN${result.expected}$RESET'); - Sys.println(' - $RESET$BOLD$WHITE Returned:$RESET $ITALIC$RED${result.returned}$RESET'); + Sys.println(' - $RESET$BOLD$WHITE Expected:$RESET $ITALIC$GREEN${safeStringify(result.expected)}$RESET'); + Sys.println(' - $RESET$BOLD$WHITE Returned:$RESET $ITALIC$RED${safeStringify(result.returned)}$RESET'); } conclusionMap.get(result.status).push(result); @@ -75,4 +78,13 @@ class Main { } } + + static function safeStringify(value:Dynamic):String { + if (Std.isOfType(value, Bytes)) { + var hex = (value : ByteArray).toHex(); + return "[" + [for (i in 0...hex.length) hex.charAt(i)].raise(2).map(array -> "0x" + array.join("")).join(", ") + "]"; + } + + return Std.string(value); + } } diff --git a/tests/generated/src/TestStatus.hx b/tests/generated/src/TestStatus.hx index e4419e4b..1c5a6d52 100644 --- a/tests/generated/src/TestStatus.hx +++ b/tests/generated/src/TestStatus.hx @@ -1,6 +1,8 @@ package; import vision.exceptions.Unimplemented; +import vision.ds.ByteArray; +import haxe.io.Bytes; enum abstract TestStatus(String) { @@ -15,6 +17,8 @@ enum abstract TestStatus(String) { overload extern public static inline function of(item:Dynamic, equals:Dynamic):TestStatus { function deepEquals (lhs:Dynamic, rhs:Dynamic) { + if (lhs is Bytes) lhs = (lhs : ByteArray).toArray(); + if (rhs is Bytes) rhs = (rhs : ByteArray).toArray(); if (lhs is Array && rhs is Array) { var lhsIterator = lhs.iterator(); var rhsIterator = rhs.iterator(); diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx index 75894802..55bc4322 100644 --- a/tests/generated/src/tests/ByteArrayTests.hx +++ b/tests/generated/src/tests/ByteArrayTests.hx @@ -13,21 +13,25 @@ import haxe.io.Bytes; class ByteArrayTests { public static function vision_ds_ByteArray__from_Int_ByteArray__ShouldWork():TestResult { try { - var value = 0; + var value = 0x00010000; var result = vision.ds.ByteArray.from(value); + var expected = new ByteArray(4); + expected.write(2, 1); return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: expected, + status: TestStatus.of(result, expected) } } catch (e) { + var expected = new ByteArray(4); + expected.write(2, 1); return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: expected, status: Failure } } @@ -35,21 +39,27 @@ class ByteArrayTests { public static function vision_ds_ByteArray__from_Int64_ByteArray__ShouldWork():TestResult { try { - var value:Int64 = null; + var value:Int64 = Int64.make(1, 1); var result = vision.ds.ByteArray.from(value); + var expected = new ByteArray(8); + expected.write(0, 1); + expected.write(4, 1); return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: expected, + status: TestStatus.of(result, expected) } } catch (e) { + var expected = new ByteArray(8); + expected.write(0, 1); + expected.write(4, 1); return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: expected, status: Failure } } @@ -57,21 +67,25 @@ class ByteArrayTests { public static function vision_ds_ByteArray__from_Float_ByteArray__ShouldWork():TestResult { try { - var value = 0.0; + var value = 1.1; var result = vision.ds.ByteArray.from(value); + var expected = new ByteArray(8); + expected.setDouble(0, 1.1); return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: expected, + status: TestStatus.of(result, expected) } } catch (e) { + var expected = new ByteArray(8); + expected.setDouble(0, 1.1); return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: expected, status: Failure } } @@ -86,14 +100,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: new ByteArray(1, 0), + status: TestStatus.of(result, new ByteArray(1, 0)) } } catch (e) { return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: new ByteArray(1, 0), status: Failure } } @@ -101,22 +115,22 @@ class ByteArrayTests { public static function vision_ds_ByteArray__from_String_haxeioEncoding_ByteArray__ShouldWork():TestResult { try { - var value = ""; - var encoding:haxe.io.Encoding = null; + var value = "Hello There!"; + var encoding:haxe.io.Encoding = UTF8; var result = vision.ds.ByteArray.from(value, encoding); return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: Bytes.ofString("Hello There!", UTF8), + status: TestStatus.of(result, Bytes.ofString("Hello There!", UTF8)) } } catch (e) { return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: Bytes.ofString("Hello There!", UTF8), status: Failure } } @@ -124,21 +138,22 @@ class ByteArrayTests { public static function vision_ds_ByteArray__from_Dynamic_ByteArray__ShouldWork():TestResult { try { - var value:Dynamic = null; + var value:Dynamic = {hey: "There!"}; var result = vision.ds.ByteArray.from(value); + var expected = Bytes.ofString(Serializer.run(value)); return { testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: expected, + status: TestStatus.of(result, expected) } } catch (e) { return { testName: "vision.ds.ByteArray.from", returned: e, - expected: null, + expected: Bytes.ofString(Serializer.run({hey: "There!"})), status: Failure } } @@ -146,26 +161,26 @@ class ByteArrayTests { public static function vision_ds_ByteArray__setUInt8__ShouldWork():TestResult { try { - var length = 0; + var length = 1; var fillWith = 0; var pos = 0; - var v = 0; + var v = 65; var object = new vision.ds.ByteArray(length, fillWith); object.setUInt8(pos, v); return { testName: "vision.ds.ByteArray#setUInt8", - returned: null, - expected: null, - status: Unimplemented + returned: object, + expected: ByteArray.from([65], 1), + status: TestStatus.of(object, ByteArray.from([65], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#setUInt8", returned: e, - expected: null, + expected: ByteArray.from([65], 1), status: Failure } } @@ -173,8 +188,8 @@ class ByteArrayTests { public static function vision_ds_ByteArray__getUInt8_Int_Int__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 1; + var fillWith = 34; var pos = 0; @@ -184,14 +199,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#getUInt8", returned: result, - expected: null, - status: Unimplemented + expected: 34, + status: TestStatus.of(result == 34) } } catch (e) { return { testName: "vision.ds.ByteArray#getUInt8", returned: e, - expected: null, + expected: 34, status: Failure } } @@ -199,26 +214,26 @@ class ByteArrayTests { public static function vision_ds_ByteArray__setUInt32__ShouldWork():TestResult { try { - var length = 0; + var length = 4; var fillWith = 0; var pos = 0; - var value:UInt = null; + var value:UInt = 0xFF763400; var object = new vision.ds.ByteArray(length, fillWith); object.setUInt32(pos, value); return { testName: "vision.ds.ByteArray#setUInt32", - returned: null, - expected: null, - status: Unimplemented + returned: object, + expected: ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1), + status: TestStatus.of(object, ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#setUInt32", returned: e, - expected: null, + expected: ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1), status: Failure } } @@ -226,8 +241,8 @@ class ByteArrayTests { public static function vision_ds_ByteArray__getUInt32_Int_UInt__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 4; + var fillWith = 0x0019F43E; var pos = 0; @@ -237,14 +252,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#getUInt32", returned: result, - expected: null, + expected: 0x0019F43E, status: Unimplemented } } catch (e) { return { testName: "vision.ds.ByteArray#getUInt32", returned: e, - expected: null, + expected: 0x0019F43E, status: Failure } } @@ -256,22 +271,22 @@ class ByteArrayTests { var fillWith = 0; var pos = 0; - var v = 0; + var v = 99; var object = new vision.ds.ByteArray(length, fillWith); object.setInt8(pos, v); return { testName: "vision.ds.ByteArray#setInt8", - returned: null, - expected: null, - status: Unimplemented + returned: object, + expected: ByteArray.from([99], 1), + status: TestStatus.of(object, ByteArray.from([99], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#setInt8", returned: e, - expected: null, + expected: ByteArray.from([99], 1), status: Failure } } @@ -279,8 +294,8 @@ class ByteArrayTests { public static function vision_ds_ByteArray__getInt8_Int_Int__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 1; + var fillWith = 193; var pos = 0; @@ -290,14 +305,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#getInt8", returned: result, - expected: null, - status: Unimplemented + expected: 193, + status: TestStatus.of(result == 193) } } catch (e) { return { testName: "vision.ds.ByteArray#getInt8", returned: e, - expected: null, + expected: 193, status: Failure } } @@ -305,26 +320,26 @@ class ByteArrayTests { public static function vision_ds_ByteArray__setBytes__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 5; + var fillWith = 1; - var pos = 0; - var array = vision.ds.ByteArray.from(0); + var pos = 1; + var array = vision.ds.ByteArray.from([2, 3, 4, 5], 1); var object = new vision.ds.ByteArray(length, fillWith); object.setBytes(pos, array); return { testName: "vision.ds.ByteArray#setBytes", - returned: null, - expected: null, - status: Unimplemented + returned: object, + expected: ByteArray.from([1, 2, 3, 4, 5], 1), + status: TestStatus.of(object, ByteArray.from([1, 2, 3, 4, 5], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#setBytes", returned: e, - expected: null, + expected: ByteArray.from([1, 2, 3, 4, 5], 1), status: Failure } } @@ -332,26 +347,23 @@ class ByteArrayTests { public static function vision_ds_ByteArray__getBytes_Int_Int_ByteArray__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; - - var pos = 0; - var length = 0; + var pos = 1; + var length = 3; - var object = new vision.ds.ByteArray(length, fillWith); + var object = ByteArray.from([1, 2, 3, 4, 5], 1); var result = object.getBytes(pos, length); return { testName: "vision.ds.ByteArray#getBytes", returned: result, - expected: null, - status: Unimplemented + expected: ByteArray.from([2, 3, 4], 1), + status: TestStatus.of(result, ByteArray.from([2, 3, 4], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#getBytes", returned: e, - expected: null, + expected: ByteArray.from([2, 3, 4], 1), status: Failure } } @@ -359,25 +371,25 @@ class ByteArrayTests { public static function vision_ds_ByteArray__resize__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 4; + var fillWith = 2; - var length = 0; + var length = 5; var object = new vision.ds.ByteArray(length, fillWith); object.resize(length); return { testName: "vision.ds.ByteArray#resize", - returned: null, - expected: null, - status: Unimplemented + returned: object, + expected: ByteArray.from([2, 2, 2, 2, 0], 1), + status: TestStatus.of(object, ByteArray.from([2, 2, 2, 2, 0], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#resize", returned: e, - expected: null, + expected: ByteArray.from([2, 2, 2, 2, 0], 1), status: Failure } } @@ -385,10 +397,10 @@ class ByteArrayTests { public static function vision_ds_ByteArray__concat_ByteArray_ByteArray__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; + var length = 2; + var fillWith = 0xEE; - var array = vision.ds.ByteArray.from(0); + var array = vision.ds.ByteArray.from(0xF1F2F3F4); var object = new vision.ds.ByteArray(length, fillWith); var result = object.concat(array); @@ -396,14 +408,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#concat", returned: result, - expected: null, - status: Unimplemented + expected: ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1), + status: TestStatus.of(result, ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#concat", returned: e, - expected: null, + expected: ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1), status: Failure } } @@ -421,14 +433,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#isEmpty", returned: result, - expected: null, - status: Unimplemented + expected: true, + status: TestStatus.of(result == true) } } catch (e) { return { testName: "vision.ds.ByteArray#isEmpty", returned: e, - expected: null, + expected: true, status: Failure } } @@ -436,13 +448,31 @@ class ByteArrayTests { public static function vision_ds_ByteArray__toArray__ArrayInt__ShouldWork():TestResult { try { - var length = 0; - var fillWith = 0; - - - var object = new vision.ds.ByteArray(length, fillWith); + var object = ByteArray.from(0x34E1B2AA); var result = object.toArray(); + return { + testName: "vision.ds.ByteArray#toArray", + returned: result, + expected: ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1), + status: TestStatus.of(result, ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1)) + } + } catch (e) { + return { + testName: "vision.ds.ByteArray#toArray", + returned: e, + expected: ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1), + status: Failure + } + } + } + + public static function vision_ds_ByteArray__fromArray__ByteArray__ShouldWork():TestResult { + try { + var value = [0x01, 0xEE10, 0xFF8709, 0x12345678]; + + var result = ByteArray.from(value); + return { testName: "vision.ds.ByteArray#toArray", returned: result, diff --git a/tests/tests.hxml b/tests/tests.hxml new file mode 100644 index 00000000..0e72e6e2 --- /dev/null +++ b/tests/tests.hxml @@ -0,0 +1,7 @@ +--cwd generated +--class-path src +--main Main +--library vision +--library format + +--interp \ No newline at end of file From f61fcbca78c4bdbd4597bb9f7ae3d4c803b7bec0 Mon Sep 17 00:00:00 2001 From: Shahar Marcus Date: Wed, 11 Jun 2025 22:29:04 +0300 Subject: [PATCH 26/32] Partial tests for color, bytearray fixed --- src/vision/ds/ByteArray.hx | 16 +-- tests/generated/src/tests/ByteArrayTests.hx | 54 ++++---- tests/generated/src/tests/ColorTests.hx | 136 ++++++++++---------- tests/tests.hxml | 2 + 4 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/vision/ds/ByteArray.hx b/src/vision/ds/ByteArray.hx index b2eaf0a3..77e1970c 100644 --- a/src/vision/ds/ByteArray.hx +++ b/src/vision/ds/ByteArray.hx @@ -76,17 +76,11 @@ abstract ByteArray(Bytes) from Bytes to Bytes { * @param itemSize The amount of bytes to capture from each item. Default is `1`, which captures only the first byte */ overload extern public static inline function from(value:Array, itemSize:Int = 1) { - var bytes = new ByteArray(value.length * itemSize); - var bytesIndex = 0; - var itemIndex = 0; - while (bytesIndex < bytes.length) { - var sizeCounter = 0; - var item = value[itemIndex++]; - while (sizeCounter < itemSize) { - bytes.set(bytesIndex + sizeCounter, item & Math.round(Math.pow(2, sizeCounter * 8) - 1)); - sizeCounter++; - } - bytesIndex += itemSize; + var bytes = new ByteArray(0); + for (item in value) { + var itemBytes = ByteArray.from(item); + itemBytes.resize(itemSize); + bytes = bytes.concat(itemBytes); } return bytes; } diff --git a/tests/generated/src/tests/ByteArrayTests.hx b/tests/generated/src/tests/ByteArrayTests.hx index 55bc4322..ce3b0b14 100644 --- a/tests/generated/src/tests/ByteArrayTests.hx +++ b/tests/generated/src/tests/ByteArrayTests.hx @@ -226,14 +226,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#setUInt32", returned: object, - expected: ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1), - status: TestStatus.of(object, ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1)) + expected: ByteArray.from([0x00, 0x34, 0x76, 0xFF], 1), + status: TestStatus.of(object, ByteArray.from([0x00, 0x34, 0x76, 0xFF], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#setUInt32", returned: e, - expected: ByteArray.from([0xFF, 0x76, 0x34, 0x00], 1), + expected: ByteArray.from([0x00, 0x34, 0x76, 0xFF], 1), status: Failure } } @@ -242,18 +242,19 @@ class ByteArrayTests { public static function vision_ds_ByteArray__getUInt32_Int_UInt__ShouldWork():TestResult { try { var length = 4; - var fillWith = 0x0019F43E; + var fillWith = 0; var pos = 0; var object = new vision.ds.ByteArray(length, fillWith); + object.setUInt32(pos, 0x0019F43E); var result = object.getUInt32(pos); return { testName: "vision.ds.ByteArray#getUInt32", returned: result, expected: 0x0019F43E, - status: Unimplemented + status: TestStatus.of(result == 0x0019F43E) } } catch (e) { return { @@ -267,7 +268,7 @@ class ByteArrayTests { public static function vision_ds_ByteArray__setInt8__ShouldWork():TestResult { try { - var length = 0; + var length = 1; var fillWith = 0; var pos = 0; @@ -305,14 +306,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#getInt8", returned: result, - expected: 193, - status: TestStatus.of(result == 193) + expected: -65, + status: TestStatus.of(result == -65) } } catch (e) { return { testName: "vision.ds.ByteArray#getInt8", returned: e, - expected: 193, + expected: -65, status: Failure } } @@ -373,11 +374,9 @@ class ByteArrayTests { try { var length = 4; var fillWith = 2; - - var length = 5; - + var object = new vision.ds.ByteArray(length, fillWith); - object.resize(length); + object.resize(5); return { testName: "vision.ds.ByteArray#resize", @@ -408,14 +407,14 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#concat", returned: result, - expected: ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1), - status: TestStatus.of(result, ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1)) + expected: ByteArray.from([0xEE, 0xEE, 0xF4, 0xF3, 0xF2, 0xF1], 1), + status: TestStatus.of(result, ByteArray.from([0xEE, 0xEE, 0xF4, 0xF3, 0xF2, 0xF1], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#concat", returned: e, - expected: ByteArray.from([0xEE, 0xEE, 0xF1, 0xF2, 0xF3, 0xF4], 1), + expected: ByteArray.from([0xEE, 0xEE, 0xF4, 0xF3, 0xF2, 0xF1], 1), status: Failure } } @@ -454,36 +453,41 @@ class ByteArrayTests { return { testName: "vision.ds.ByteArray#toArray", returned: result, - expected: ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1), - status: TestStatus.of(result, ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1)) + expected: ByteArray.from([0xAA, 0xB2, 0xE1, 0x34], 1), + status: TestStatus.of(result, ByteArray.from([0xAA, 0xB2, 0xE1, 0x34], 1)) } } catch (e) { return { testName: "vision.ds.ByteArray#toArray", returned: e, - expected: ByteArray.from([0x34, 0xE1, 0xB2, 0xAA], 1), + expected: ByteArray.from([0xAA, 0xB2, 0xE1, 0x34], 1), status: Failure } } } public static function vision_ds_ByteArray__fromArray__ByteArray__ShouldWork():TestResult { + var expected = Bytes.alloc(16); + expected.setInt32(0, 0x01); + expected.setInt32(4, 0xEE10); + expected.setInt32(8, 0xFF8709); + expected.setInt32(12, 0x12345678); try { var value = [0x01, 0xEE10, 0xFF8709, 0x12345678]; - var result = ByteArray.from(value); - + var result = ByteArray.from(value, 4); + return { - testName: "vision.ds.ByteArray#toArray", + testName: "vision.ds.ByteArray.from", returned: result, - expected: null, - status: Unimplemented + expected: expected, + status: TestStatus.of(result, expected) } } catch (e) { return { testName: "vision.ds.ByteArray#toArray", returned: e, - expected: null, + expected: expected, status: Failure } } diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index b5aa53f9..647aacd4 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -11,7 +11,7 @@ import vision.tools.MathTools; class ColorTests { public static function vision_ds_Color__red__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.red; @@ -19,14 +19,14 @@ class ColorTests { return { testName: "vision.ds.Color#red", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF, + status: TestStatus.of(result == 0xFF) } } catch (e) { return { testName: "vision.ds.Color#red", returned: e, - expected: null, + expected: 0xFF, status: Failure } } @@ -34,7 +34,7 @@ class ColorTests { public static function vision_ds_Color__blue__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.blue; @@ -42,14 +42,14 @@ class ColorTests { return { testName: "vision.ds.Color#blue", returned: result, - expected: null, - status: Unimplemented + expected: 0x34, + status: TestStatus.of(result == 0x34) } } catch (e) { return { testName: "vision.ds.Color#blue", returned: e, - expected: null, + expected: 0x34, status: Failure } } @@ -57,7 +57,7 @@ class ColorTests { public static function vision_ds_Color__green__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.green; @@ -65,14 +65,14 @@ class ColorTests { return { testName: "vision.ds.Color#green", returned: result, - expected: null, - status: Unimplemented + expected: 0x76, + status: TestStatus.of(result == 0x76) } } catch (e) { return { testName: "vision.ds.Color#green", returned: e, - expected: null, + expected: 0x76, status: Failure } } @@ -80,7 +80,7 @@ class ColorTests { public static function vision_ds_Color__alpha__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.alpha; @@ -88,14 +88,14 @@ class ColorTests { return { testName: "vision.ds.Color#alpha", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF, + status: TestStatus.of(result == 0xFF) } } catch (e) { return { testName: "vision.ds.Color#alpha", returned: e, - expected: null, + expected: 0xFF, status: Failure } } @@ -103,7 +103,7 @@ class ColorTests { public static function vision_ds_Color__redFloat__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.redFloat; @@ -111,14 +111,14 @@ class ColorTests { return { testName: "vision.ds.Color#redFloat", returned: result, - expected: null, - status: Unimplemented + expected: 1.0, + status: TestStatus.of(result == 1.0) } } catch (e) { return { testName: "vision.ds.Color#redFloat", returned: e, - expected: null, + expected: 1.0, status: Failure } } @@ -126,7 +126,7 @@ class ColorTests { public static function vision_ds_Color__blueFloat__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.blueFloat; @@ -134,14 +134,14 @@ class ColorTests { return { testName: "vision.ds.Color#blueFloat", returned: result, - expected: null, - status: Unimplemented + expected: 0x34 / 255.0, + status: TestStatus.of(result == 0x34 / 255.0) } } catch (e) { return { testName: "vision.ds.Color#blueFloat", returned: e, - expected: null, + expected: 0x34 / 255.0, status: Failure } } @@ -149,7 +149,7 @@ class ColorTests { public static function vision_ds_Color__greenFloat__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.greenFloat; @@ -157,14 +157,14 @@ class ColorTests { return { testName: "vision.ds.Color#greenFloat", returned: result, - expected: null, - status: Unimplemented + expected: 0x76 / 255.0, + status: TestStatus.of(result == 0x76 / 255.0) } } catch (e) { return { testName: "vision.ds.Color#greenFloat", returned: e, - expected: null, + expected: 0x76 / 255.0, status: Failure } } @@ -172,7 +172,7 @@ class ColorTests { public static function vision_ds_Color__alphaFloat__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.alphaFloat; @@ -180,14 +180,14 @@ class ColorTests { return { testName: "vision.ds.Color#alphaFloat", returned: result, - expected: null, - status: Unimplemented + expected: 1.0, + status: TestStatus.of(result == 1.0) } } catch (e) { return { testName: "vision.ds.Color#alphaFloat", returned: e, - expected: null, + expected: 1.0, status: Failure } } @@ -195,7 +195,7 @@ class ColorTests { public static function vision_ds_Color__cyan__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.cyan; @@ -203,14 +203,14 @@ class ColorTests { return { testName: "vision.ds.Color#cyan", returned: result, - expected: null, - status: Unimplemented + expected: 0, + status: TestStatus.of(result == 0) } } catch (e) { return { testName: "vision.ds.Color#cyan", returned: e, - expected: null, + expected: 0, status: Failure } } @@ -218,7 +218,7 @@ class ColorTests { public static function vision_ds_Color__magenta__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.magenta; @@ -226,14 +226,14 @@ class ColorTests { return { testName: "vision.ds.Color#magenta", returned: result, - expected: null, - status: Unimplemented + expected: 54, + status: TestStatus.of(result == 54) } } catch (e) { return { testName: "vision.ds.Color#magenta", returned: e, - expected: null, + expected: 54, status: Failure } } @@ -241,7 +241,7 @@ class ColorTests { public static function vision_ds_Color__yellow__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.yellow; @@ -249,14 +249,14 @@ class ColorTests { return { testName: "vision.ds.Color#yellow", returned: result, - expected: null, - status: Unimplemented + expected: 80, + status: TestStatus.of(result == 80) } } catch (e) { return { testName: "vision.ds.Color#yellow", returned: e, - expected: null, + expected: 80, status: Failure } } @@ -264,7 +264,7 @@ class ColorTests { public static function vision_ds_Color__black__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.black; @@ -272,14 +272,14 @@ class ColorTests { return { testName: "vision.ds.Color#black", returned: result, - expected: null, - status: Unimplemented + expected: 0, + status: TestStatus.of(result == 0) } } catch (e) { return { testName: "vision.ds.Color#black", returned: e, - expected: null, + expected: 0, status: Failure } } @@ -287,7 +287,7 @@ class ColorTests { public static function vision_ds_Color__rgb__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.rgb; @@ -295,14 +295,14 @@ class ColorTests { return { testName: "vision.ds.Color#rgb", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF7634, + status: TestStatus.of(result == 0xFF7634) } } catch (e) { return { testName: "vision.ds.Color#rgb", returned: e, - expected: null, + expected: 0xFF7634, status: Failure } } @@ -310,7 +310,7 @@ class ColorTests { public static function vision_ds_Color__hue__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.hue; @@ -318,14 +318,14 @@ class ColorTests { return { testName: "vision.ds.Color#hue", returned: result, - expected: null, - status: Unimplemented + expected: 20.0, + status: TestStatus.of(result == 20.0) } } catch (e) { return { testName: "vision.ds.Color#hue", returned: e, - expected: null, + expected: 20.0, status: Failure } } @@ -333,7 +333,7 @@ class ColorTests { public static function vision_ds_Color__saturation__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.saturation; @@ -341,14 +341,14 @@ class ColorTests { return { testName: "vision.ds.Color#saturation", returned: result, - expected: null, - status: Unimplemented + expected: 1.0, + status: TestStatus.of(result == 1.0) } } catch (e) { return { testName: "vision.ds.Color#saturation", returned: e, - expected: null, + expected: 1.0, status: Failure } } @@ -356,7 +356,7 @@ class ColorTests { public static function vision_ds_Color__brightness__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.brightness; @@ -364,14 +364,14 @@ class ColorTests { return { testName: "vision.ds.Color#brightness", returned: result, - expected: null, - status: Unimplemented + expected: 1, + status: TestStatus.of(result == 1) } } catch (e) { return { testName: "vision.ds.Color#brightness", returned: e, - expected: null, + expected: 1, status: Failure } } @@ -379,7 +379,7 @@ class ColorTests { public static function vision_ds_Color__lightness__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var object = new vision.ds.Color(value); var result = object.lightness; @@ -387,14 +387,14 @@ class ColorTests { return { testName: "vision.ds.Color#lightness", returned: result, - expected: null, - status: Unimplemented + expected: 0.6, + status: TestStatus.of(result == 0.6) } } catch (e) { return { testName: "vision.ds.Color#lightness", returned: e, - expected: null, + expected: 0.6, status: Failure } } diff --git a/tests/tests.hxml b/tests/tests.hxml index 0e72e6e2..dbe3da2b 100644 --- a/tests/tests.hxml +++ b/tests/tests.hxml @@ -4,4 +4,6 @@ --library vision --library format +-w -WDeprecated + --interp \ No newline at end of file From 504bc5cd183072d8ba2b207aea4e60a89442e5d8 Mon Sep 17 00:00:00 2001 From: Shahar Marcus Date: Thu, 12 Jun 2025 00:17:43 +0300 Subject: [PATCH 27/32] some more tests --- tests/generated/src/Main.hx | 51 +++++++++- tests/generated/src/TestsToRun.hx | 84 ++++++++-------- tests/generated/src/tests/ColorTests.hx | 128 ++++++++++++------------ 3 files changed, 158 insertions(+), 105 deletions(-) diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index ba42ae52..7fc11e7d 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -1,5 +1,7 @@ package; +import vision.tools.MathTools; +import haxe.SysTools; import vision.ds.ByteArray; import haxe.io.Bytes; import tests.*; @@ -26,6 +28,17 @@ class Main { static var GRAY = "\033[90m"; static var RESET = "\033[0m"; + static var RED_BACKGROUND = "\033[41m"; + static var GREEN_BACKGROUND = "\033[42m"; + static var YELLOW_BACKGROUND = "\033[43m"; + static var BLUE_BACKGROUND = "\033[44m"; + static var MAGENTA_BACKGROUND = "\033[45m"; + static var CYAN_BACKGROUND = "\033[46m"; + static var WHITE_BACKGROUND = "\033[47m"; + static var BLACK_BACKGROUND = "\033[40m"; + static var LIGHT_BLUE_BACKGROUND = "\033[104m"; + static var GRAY_BACKGROUND = "\033[100m"; + static var BOLD = "\033[1m"; static var ITALIC = "\033[3m"; static var UNDERLINE = "\033[4m"; @@ -57,7 +70,7 @@ class Main { Sys.sleep(bulk ? 0.01 : 0.2); } } - + Sys.println(getTestStatusBar(conclusionMap.get(Success).length, conclusionMap.get(Failure).length, conclusionMap.get(Skipped).length, conclusionMap.get(Unimplemented).length)); if (conclusionMap.get(Success).length == i) { Sys.println('$GREEN$BOLD🥳 🥳 🥳 All tests passed! 🥳 🥳 🥳$RESET'); } else { @@ -67,6 +80,8 @@ class Main { Sys.println(' - $RESET$BOLD${getTestPassColor(Skipped)} ${conclusionMap.get(Skipped).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Skipped)} Skipped 🤷$RESET'); Sys.println(' - $RESET$BOLD${getTestPassColor(Unimplemented)} ${conclusionMap.get(Unimplemented).length}$RESET $BOLD$WHITE Tests $RESET$BOLD${getTestPassColor(Unimplemented)} Unimplemented 😬$RESET'); } + Sys.println(getTestStatusBar(conclusionMap.get(Success).length, conclusionMap.get(Failure).length, conclusionMap.get(Skipped).length, conclusionMap.get(Unimplemented).length)); + } static function getTestPassColor(status:TestStatus):String { @@ -87,4 +102,38 @@ class Main { return Std.string(value); } + + static function getTestStatusBar(successes:Int, failures:Int, skipped:Int, unimplemented:Int):String { + var consoleWidth = 100; + + consoleWidth -= 3; + + var successPercent = successes / (successes + failures + skipped + unimplemented); + var successWidth = MathTools.round(successPercent * consoleWidth); + + var failurePercent = failures / (successes + failures + skipped + unimplemented); + var failureWidth = MathTools.round(failurePercent * consoleWidth); + + var skippedPercent = skipped / (successes + failures + skipped + unimplemented); + var skippedWidth = MathTools.round(skippedPercent * consoleWidth); + + var unimplementedPercent = unimplemented / (successes + failures + skipped + unimplemented); + var unimplementedWidth = MathTools.round(unimplementedPercent * consoleWidth); + + var output = '╔${[for (_ in 0...consoleWidth + 2) '═'].join('')}╗\n'; + + output += '║ $RESET$BOLD$GREEN_BACKGROUND'; + for (_ in 0...successWidth) output += ' '; + output += '$RED_BACKGROUND'; + for (_ in 0...failureWidth) output += ' '; + output += '$LIGHT_BLUE_BACKGROUND'; + for (_ in 0...skippedWidth) output += ' '; + output += '$GRAY_BACKGROUND'; + for (_ in 0...unimplementedWidth) output += ' '; + output += '$RESET ║'; + + output += '\n╚${[for (_ in 0...consoleWidth + 2) '═'].join('')}╝'; + return output; + + } } diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index 31ea86a0..3d641ac0 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -3,50 +3,50 @@ package; import tests.*; final tests:Array> = [ - BilateralFilterTests, - BilinearInterpolationTests, - CannyTests, - CramerTests, - GaussTests, - GaussJordanTests, - ImageHashingTests, - KMeansTests, - LaplaceTests, - PerspectiveWarpTests, - PerwittTests, - RadixTests, - RobertsCrossTests, - SimpleHoughTests, - SimpleLineDetectorTests, - SobelTests, + // BilateralFilterTests, + // BilinearInterpolationTests, + // CannyTests, + // CramerTests, + // GaussTests, + // GaussJordanTests, + // ImageHashingTests, + // KMeansTests, + // LaplaceTests, + // PerspectiveWarpTests, + // PerwittTests, + // RadixTests, + // RobertsCrossTests, + // SimpleHoughTests, + // SimpleLineDetectorTests, + // SobelTests, Array2DTests, ByteArrayTests, - CannyObjectTests, + // CannyObjectTests, ColorTests, - HistogramTests, - ImageTests, - ImageViewTests, - Int16Point2DTests, - IntPoint2DTests, - ColorClusterTests, - Line2DTests, - Matrix2DTests, - PixelTests, - Point2DTests, - Point3DTests, - QueueTests, - QueueCellTests, - Ray2DTests, - RectangleTests, - PointTransformationPairTests, - TransformationMatrix2DTests, - UInt16Point2DTests, - ImageIOTests, - FormatImageExporterTests, - FormatImageLoaderTests, - VisionThreadTests, + // HistogramTests, + // ImageTests, + // ImageViewTests, + // Int16Point2DTests, + // IntPoint2DTests, + // ColorClusterTests, + // Line2DTests, + // Matrix2DTests, + // PixelTests, + // Point2DTests, + // Point3DTests, + // QueueTests, + // QueueCellTests, + // Ray2DTests, + // RectangleTests, + // PointTransformationPairTests, + // TransformationMatrix2DTests, + // UInt16Point2DTests, + // ImageIOTests, + // FormatImageExporterTests, + // FormatImageLoaderTests, + // VisionThreadTests, ArrayToolsTests, - ImageToolsTests, - MathToolsTests, - VisionTests + // ImageToolsTests, + // MathToolsTests, + // VisionTests ]; \ No newline at end of file diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index 647aacd4..45bd2e2a 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -402,21 +402,21 @@ class ColorTests { public static function vision_ds_Color__fromInt_Int_Color__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFFFF7634; var result = vision.ds.Color.fromInt(value); return { testName: "vision.ds.Color.fromInt", returned: result, - expected: null, - status: Unimplemented + expected: 0xFFFF7634, + status: TestStatus.of(result == 0xFFFF7634) } } catch (e) { return { testName: "vision.ds.Color.fromInt", returned: e, - expected: null, + expected: 0xFFFF7634, status: Failure } } @@ -424,24 +424,24 @@ class ColorTests { public static function vision_ds_Color__fromRGBA_Int_Int_Int_Int_Color__ShouldWork():TestResult { try { - var Red = 0; - var Green = 0; - var Blue = 0; - var Alpha = 0; + var Red = 128; + var Green = 128; + var Blue = 34; + var Alpha = 44; var result = vision.ds.Color.fromRGBA(Red, Green, Blue, Alpha); return { testName: "vision.ds.Color.fromRGBA", returned: result, - expected: null, - status: Unimplemented + expected: 0x2C808022, + status: TestStatus.of(result == 0x2C808022) } } catch (e) { return { testName: "vision.ds.Color.fromRGBA", returned: e, - expected: null, + expected: 0x2C808022, status: Failure } } @@ -449,21 +449,21 @@ class ColorTests { public static function vision_ds_Color__from8Bit_Int_Color__ShouldWork():TestResult { try { - var Value = 0; + var Value = 0x11; var result = vision.ds.Color.from8Bit(Value); return { testName: "vision.ds.Color.from8Bit", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF111111, + status: TestStatus.of(result == 0xFF111111) } } catch (e) { return { testName: "vision.ds.Color.from8Bit", returned: e, - expected: null, + expected: 0xFF111111, status: Failure } } @@ -471,21 +471,21 @@ class ColorTests { public static function vision_ds_Color__fromFloat_Float_Color__ShouldWork():TestResult { try { - var Value = 0.0; + var Value = 0.5; var result = vision.ds.Color.fromFloat(Value); return { testName: "vision.ds.Color.fromFloat", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF808080, + status: TestStatus.of(result == 0xFF808080) } } catch (e) { return { testName: "vision.ds.Color.fromFloat", returned: e, - expected: null, + expected: 0xFF808080, status: Failure } } @@ -493,24 +493,24 @@ class ColorTests { public static function vision_ds_Color__fromRGBAFloat_Float_Float_Float_Float_Color__ShouldWork():TestResult { try { - var Red = 0.0; - var Green = 0.0; - var Blue = 0.0; - var Alpha = 0.0; + var Red = 0.5; + var Green = 0.5; + var Blue = 0.5; + var Alpha = 0.5; var result = vision.ds.Color.fromRGBAFloat(Red, Green, Blue, Alpha); return { testName: "vision.ds.Color.fromRGBAFloat", returned: result, - expected: null, + expected: 0x80808080, status: Unimplemented } } catch (e) { return { testName: "vision.ds.Color.fromRGBAFloat", returned: e, - expected: null, + expected: 0x80808080, status: Failure } } @@ -530,7 +530,7 @@ class ColorTests { testName: "vision.ds.Color.fromCMYK", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -555,7 +555,7 @@ class ColorTests { testName: "vision.ds.Color.fromHSB", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -580,7 +580,7 @@ class ColorTests { testName: "vision.ds.Color.fromHSL", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -595,20 +595,25 @@ class ColorTests { public static function vision_ds_Color__fromString_String_NullColor__ShouldWork():TestResult { try { var str = ""; - - var result = vision.ds.Color.fromString(str); + var sets = ["0x00FF00" => 0xFF00FF00, + "0xAA4578C2" => 0xAA4578C2, + "#0000FF" => 0xFF0000FF, + "#3F000011" => 0x3F000011, + "GRAY" => 0xFF808080, + "blue" => 0xFF0000FF]; + var result = [for (key in sets.keys()) key].map(key -> Color.fromString(key)); return { testName: "vision.ds.Color.fromString", returned: result, - expected: null, - status: Unimplemented + expected: [for (value in sets.iterator()) value], + status: TestStatus.of(result == [for (value in sets.iterator()) value]) } } catch (e) { return { testName: "vision.ds.Color.fromString", returned: e, - expected: null, + expected: [0xFF00FF00, 0xAA4578C2, 0xFF0000FF, 0x3F000011, 0xFF808080, 0xFF0000FF], status: Failure } } @@ -624,7 +629,7 @@ class ColorTests { testName: "vision.ds.Color.getHSBColorWheel", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -638,23 +643,23 @@ class ColorTests { public static function vision_ds_Color__interpolate_Color_Color_Float_Color__ShouldWork():TestResult { try { - var Color1:Color = null; - var Color2:Color = null; - var Factor = 0.0; + var Color1:Color = 0xFF00FF00; + var Color2:Color = 0x00FF00FF; + var Factor = 0.5; var result = vision.ds.Color.interpolate(Color1, Color2, Factor); return { testName: "vision.ds.Color.interpolate", returned: result, - expected: null, - status: Unimplemented + expected: 0x7F7F7F7F, + status: TestStatus.of(result == 0x7F7F7F7F) } } catch (e) { return { testName: "vision.ds.Color.interpolate", returned: e, - expected: null, + expected: 0x7F7F7F7F, status: Failure } } @@ -673,7 +678,7 @@ class ColorTests { testName: "vision.ds.Color.gradient", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -687,22 +692,21 @@ class ColorTests { public static function vision_ds_Color__makeRandom_Bool_Int_Color__ShouldWork():TestResult { try { - var alphaLock = false; var alphaValue = 0; - var result = vision.ds.Color.makeRandom(alphaLock, alphaValue); + var result = vision.ds.Color.makeRandom(alphaValue); return { testName: "vision.ds.Color.makeRandom", - returned: result, - expected: null, - status: Unimplemented + returned: result.alpha, + expected: 0, + status: TestStatus.of(result.alpha == 0) } } catch (e) { return { testName: "vision.ds.Color.makeRandom", returned: e, - expected: null, + expected: 0, status: Failure } } @@ -710,22 +714,22 @@ class ColorTests { public static function vision_ds_Color__multiply_Color_Color_Color__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = 0x020202; + var rhs:Color = 0x030303; var result = vision.ds.Color.multiply(lhs, rhs); return { testName: "vision.ds.Color.multiply", returned: result, - expected: null, - status: Unimplemented + expected: 0x060606, + status: TestStatus.of(result == 0x060606) } } catch (e) { return { testName: "vision.ds.Color.multiply", returned: e, - expected: null, + expected: 0x060606, status: Failure } } @@ -733,22 +737,22 @@ class ColorTests { public static function vision_ds_Color__add_Color_Color_Color__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = 0x020202; + var rhs:Color = 0x030303; var result = vision.ds.Color.add(lhs, rhs); return { testName: "vision.ds.Color.add", returned: result, - expected: null, - status: Unimplemented + expected: 0x050505, + status: TestStatus.of(result == 0x050505) } } catch (e) { return { testName: "vision.ds.Color.add", returned: e, - expected: null, + expected: 0x050505, status: Failure } } @@ -756,22 +760,22 @@ class ColorTests { public static function vision_ds_Color__subtract_Color_Color_Color__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = 0x040404; + var rhs:Color = 0x030303; var result = vision.ds.Color.subtract(lhs, rhs); return { testName: "vision.ds.Color.subtract", returned: result, - expected: null, - status: Unimplemented + expected: 0x010101, + status: TestStatus.of(result == 0x010101) } } catch (e) { return { testName: "vision.ds.Color.subtract", returned: e, - expected: null, + expected: 0x010101, status: Failure } } From 8ff82f232d002155f6df29c72329976f981bb22c Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sat, 14 Jun 2025 22:55:10 +0300 Subject: [PATCH 28/32] done with tests for Color, fix some tests as well --- tests/generated/src/Main.hx | 2 +- tests/generated/src/tests/ColorTests.hx | 185 ++++++++++++------------ 2 files changed, 94 insertions(+), 93 deletions(-) diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 7fc11e7d..86c04dba 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -106,7 +106,7 @@ class Main { static function getTestStatusBar(successes:Int, failures:Int, skipped:Int, unimplemented:Int):String { var consoleWidth = 100; - consoleWidth -= 3; + consoleWidth -= 2; var successPercent = successes / (successes + failures + skipped + unimplemented); var successWidth = MathTools.round(successPercent * consoleWidth); diff --git a/tests/generated/src/tests/ColorTests.hx b/tests/generated/src/tests/ColorTests.hx index 45bd2e2a..1517f8b7 100644 --- a/tests/generated/src/tests/ColorTests.hx +++ b/tests/generated/src/tests/ColorTests.hx @@ -504,7 +504,7 @@ class ColorTests { testName: "vision.ds.Color.fromRGBAFloat", returned: result, expected: 0x80808080, - status: Unimplemented + status: TestStatus.of(result == 0x80808080) } } catch (e) { return { @@ -783,22 +783,22 @@ class ColorTests { public static function vision_ds_Color__divide_Color_Color_Color__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = 0x060606; + var rhs:Color = 0x010101; var result = vision.ds.Color.divide(lhs, rhs); return { testName: "vision.ds.Color.divide", returned: result, - expected: null, - status: Unimplemented + expected: 0x060606, + status: TestStatus.of(result == 0x060606) } } catch (e) { return { testName: "vision.ds.Color.divide", returned: e, - expected: null, + expected: 0x060606, status: Failure } } @@ -806,8 +806,8 @@ class ColorTests { public static function vision_ds_Color__distanceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = 0x020202; + var rhs:Color = 0x010101; var considerTransparency = false; var result = vision.ds.Color.distanceBetween(lhs, rhs, considerTransparency); @@ -815,14 +815,14 @@ class ColorTests { return { testName: "vision.ds.Color.distanceBetween", returned: result, - expected: null, - status: Unimplemented + expected: MathTools.SQRT3, + status: TestStatus.of(result == MathTools.SQRT3) } } catch (e) { return { testName: "vision.ds.Color.distanceBetween", returned: e, - expected: null, + expected: MathTools.SQRT3, status: Failure } } @@ -830,8 +830,8 @@ class ColorTests { public static function vision_ds_Color__differenceBetween_Color_Color_Bool_Float__ShouldWork():TestResult { try { - var lhs:Color = null; - var rhs:Color = null; + var lhs:Color = Color.WHITE; + var rhs:Color = Color.BLACK; var considerTransparency = false; var result = vision.ds.Color.differenceBetween(lhs, rhs, considerTransparency); @@ -839,14 +839,14 @@ class ColorTests { return { testName: "vision.ds.Color.differenceBetween", returned: result, - expected: null, - status: Unimplemented + expected: 1, + status: TestStatus.of(result == 1) } } catch (e) { return { testName: "vision.ds.Color.differenceBetween", returned: e, - expected: null, + expected: 1, status: Failure } } @@ -854,7 +854,7 @@ class ColorTests { public static function vision_ds_Color__getAverage_ArrayColor_Bool_Color__ShouldWork():TestResult { try { - var fromColors = []; + var fromColors = [Color.RED, Color.GREEN, Color.BLUE]; var considerTransparency = false; var result = vision.ds.Color.getAverage(fromColors, considerTransparency); @@ -862,14 +862,14 @@ class ColorTests { return { testName: "vision.ds.Color.getAverage", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF555555, + status: TestStatus.of(result == 0xFF555555) } } catch (e) { return { testName: "vision.ds.Color.getAverage", returned: e, - expected: null, + expected: 0xFF555555, status: Failure } } @@ -887,7 +887,7 @@ class ColorTests { testName: "vision.ds.Color#getComplementHarmony", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -912,7 +912,7 @@ class ColorTests { testName: "vision.ds.Color#getAnalogousHarmony", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -937,7 +937,7 @@ class ColorTests { testName: "vision.ds.Color#getSplitComplementHarmony", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -961,7 +961,7 @@ class ColorTests { testName: "vision.ds.Color#getTriadicHarmony", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -975,7 +975,7 @@ class ColorTests { public static function vision_ds_Color__to24Bit__Color__ShouldWork():TestResult { try { - var value = 0; + var value = 0x55555555; var object = new vision.ds.Color(value); @@ -984,14 +984,14 @@ class ColorTests { return { testName: "vision.ds.Color#to24Bit", returned: result, - expected: null, - status: Unimplemented + expected: 0x555555, + status: TestStatus.of(result == 0x555555) } } catch (e) { return { testName: "vision.ds.Color#to24Bit", returned: e, - expected: null, + expected: 0x555555, status: Failure } } @@ -999,10 +999,10 @@ class ColorTests { public static function vision_ds_Color__toHexString_Bool_Bool_String__ShouldWork():TestResult { try { - var value = 0; + var value = Color.ROYAL_BLUE; - var Alpha = false; - var Prefix = false; + var Alpha = true; + var Prefix = true; var object = new vision.ds.Color(value); var result = object.toHexString(Alpha, Prefix); @@ -1010,14 +1010,14 @@ class ColorTests { return { testName: "vision.ds.Color#toHexString", returned: result, - expected: null, - status: Unimplemented + expected: "0xFF4169E1", + status: TestStatus.of(result == "0xFF4169E1") } } catch (e) { return { testName: "vision.ds.Color#toHexString", returned: e, - expected: null, + expected: "0xFF4169E1", status: Failure } } @@ -1025,7 +1025,7 @@ class ColorTests { public static function vision_ds_Color__toWebString__String__ShouldWork():TestResult { try { - var value = 0; + var value = Color.ROYAL_BLUE; var object = new vision.ds.Color(value); @@ -1034,14 +1034,14 @@ class ColorTests { return { testName: "vision.ds.Color#toWebString", returned: result, - expected: null, - status: Unimplemented + expected: "#4169E1", + status: TestStatus.of(result == "#4169E1") } } catch (e) { return { testName: "vision.ds.Color#toWebString", returned: e, - expected: null, + expected: "#4169E1", status: Failure } } @@ -1049,9 +1049,9 @@ class ColorTests { public static function vision_ds_Color__darken_Float_Color__ShouldWork():TestResult { try { - var value = 0; + var value = Color.WHITE; - var Factor = 0.0; + var Factor = 0.5; var object = new vision.ds.Color(value); var result = object.darken(Factor); @@ -1059,14 +1059,14 @@ class ColorTests { return { testName: "vision.ds.Color#darken", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF7F7F7F, + status: TestStatus.of(result == 0xFF7F7F7F) } } catch (e) { return { testName: "vision.ds.Color#darken", returned: e, - expected: null, + expected: 0xFF7F7F7F, status: Failure } } @@ -1074,9 +1074,9 @@ class ColorTests { public static function vision_ds_Color__lighten_Float_Color__ShouldWork():TestResult { try { - var value = 0; + var value = Color.BLACK; - var Factor = 0.0; + var Factor = 0.5; var object = new vision.ds.Color(value); var result = object.lighten(Factor); @@ -1084,14 +1084,14 @@ class ColorTests { return { testName: "vision.ds.Color#lighten", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF7F7F7F, + status: TestStatus.of(result == 0xFF7F7F7F) } } catch (e) { return { testName: "vision.ds.Color#lighten", returned: e, - expected: null, + expected: 0xFF7F7F7F, status: Failure } } @@ -1099,23 +1099,22 @@ class ColorTests { public static function vision_ds_Color__invert__Color__ShouldWork():TestResult { try { - var value = 0; + var value = Color.AMETHYST; var object = new vision.ds.Color(value); var result = object.invert(); - return { testName: "vision.ds.Color#invert", returned: result, - expected: null, - status: Unimplemented + expected: 0xFF669933, + status: TestStatus.of(result == 0xFF669933) } } catch (e) { return { testName: "vision.ds.Color#invert", returned: e, - expected: null, + expected: 0xFF669933, status: Failure } } @@ -1125,10 +1124,10 @@ class ColorTests { try { var value = 0; - var Red = 0; - var Green = 0; - var Blue = 0; - var Alpha = 0; + var Red = 10; + var Green = 20; + var Blue = 30; + var Alpha = 40; var object = new vision.ds.Color(value); var result = object.setRGBA(Red, Green, Blue, Alpha); @@ -1136,14 +1135,14 @@ class ColorTests { return { testName: "vision.ds.Color#setRGBA", returned: result, - expected: null, - status: Unimplemented + expected: 0x281E140A, + status: TestStatus.of(result == 0x281E140A) } } catch (e) { return { testName: "vision.ds.Color#setRGBA", returned: e, - expected: null, + expected: 0x281E140A, status: Failure } } @@ -1153,10 +1152,10 @@ class ColorTests { try { var value = 0; - var Red = 0.0; - var Green = 0.0; - var Blue = 0.0; - var Alpha = 0.0; + var Red = 0.5; + var Green = 0.5; + var Blue = 0.5; + var Alpha = 0.5; var object = new vision.ds.Color(value); var result = object.setRGBAFloat(Red, Green, Blue, Alpha); @@ -1164,14 +1163,14 @@ class ColorTests { return { testName: "vision.ds.Color#setRGBAFloat", returned: result, - expected: null, - status: Unimplemented + expected: 0x7F7F7F7F, + status: TestStatus.of(result == 0x7F7F7F7F) } } catch (e) { return { testName: "vision.ds.Color#setRGBAFloat", returned: e, - expected: null, + expected: 0x7F7F7F7F, status: Failure } } @@ -1194,7 +1193,7 @@ class ColorTests { testName: "vision.ds.Color#setCMYK", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -1222,7 +1221,7 @@ class ColorTests { testName: "vision.ds.Color#setHSB", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -1250,7 +1249,7 @@ class ColorTests { testName: "vision.ds.Color#setHSL", returned: result, expected: null, - status: Unimplemented + status: Skipped } } catch (e) { return { @@ -1264,24 +1263,26 @@ class ColorTests { public static function vision_ds_Color__grayscale_Bool_Color__ShouldWork():TestResult { try { - var value = 0; - - var simple = false; - - var object = new vision.ds.Color(value); - var result = object.grayscale(simple); + var object = Color.ALABASTER; + + var resultRegular = object.grayscale(false); + var resultSimple = object.grayscale(true); return { testName: "vision.ds.Color#grayscale", - returned: result, - expected: null, - status: Unimplemented + returned: '${resultRegular.toHexString()}, Then: ${resultSimple.toHexString()}', + expected: '${Color.from8Bit(Std.int(0.2126 * object.red + 0.7152 * object.green + 0.0722 * object.blue)).toHexString()}, Then: ${Color.from8Bit(Std.int((object.red + object.green + object.blue) / 3)).toHexString()}', + status: TestStatus.multiple( + TestStatus.of(resultRegular.red == Std.int(0.2126 * object.red + 0.7152 * object.green + 0.0722 * object.blue)), + TestStatus.of(resultSimple.red == Std.int((object.red + object.green + object.blue) / 3)) + ) } } catch (e) { + var object = Color.ALABASTER; return { testName: "vision.ds.Color#grayscale", returned: e, - expected: null, + expected: '${Color.from8Bit(Std.int(0.2126 * object.red + 0.7152 * object.green + 0.0722 * object.blue)).toHexString()}, Then: ${Color.from8Bit(Std.int((object.red + object.green + object.blue) / 3)).toHexString()}', status: Failure } } @@ -1289,7 +1290,7 @@ class ColorTests { public static function vision_ds_Color__blackOrWhite_Int_Color__ShouldWork():TestResult { try { - var value = 0; + var value = 0xFF45E312; var threshold = 0; @@ -1299,14 +1300,14 @@ class ColorTests { return { testName: "vision.ds.Color#blackOrWhite", returned: result, - expected: null, - status: Unimplemented + expected: 0xFFFFFFFF, + status: TestStatus.of(result == 0xFFFFFFFF) } } catch (e) { return { testName: "vision.ds.Color#blackOrWhite", returned: e, - expected: null, + expected: 0xFFFFFFFF, status: Failure } } @@ -1314,7 +1315,7 @@ class ColorTests { public static function vision_ds_Color__toString__ShouldWork():TestResult { try { - var value = 0; + var value = Color.AZURE; var object = new vision.ds.Color(value); @@ -1322,15 +1323,15 @@ class ColorTests { return { testName: "vision.ds.Color#toString", - returned: null, - expected: null, - status: Unimplemented + returned: #if console.hx ' ' #else object.toHexString(true, true) #end, + expected: #if console.hx ' ' #else "0xFF007FFF" #end, + status: TestStatus.of(object.toString() == #if console.hx ' ' #else "0xFF007FFF" #end) } } catch (e) { return { testName: "vision.ds.Color#toString", returned: e, - expected: null, + expected: #if console.hx ' ' #else "0xFF007FFF" #end, status: Failure } } @@ -1347,14 +1348,14 @@ class ColorTests { return { testName: "vision.ds.Color#toInt", returned: result, - expected: null, - status: Unimplemented + expected: 0, + status: TestStatus.of(result == 0) } } catch (e) { return { testName: "vision.ds.Color#toInt", returned: e, - expected: null, + expected: 0, status: Failure } } From fb66ad8586204363f8bbef3d024651111fbc80c0 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:23:22 +0300 Subject: [PATCH 29/32] More tests, need to fix the test resolve bar sometime in the future --- tests/generated/src/Main.hx | 6 +- tests/generated/src/TestsToRun.hx | 82 +++++++++---------- tests/generated/src/tests/IntPoint2DTests.hx | 74 ++++++++--------- tests/generated/src/tests/Point2DTests.hx | 44 +++++----- tests/generated/src/tests/Point3DTests.hx | 34 ++++---- .../generated/src/tests/UInt16Point2DTests.hx | 58 ++++++------- 6 files changed, 149 insertions(+), 149 deletions(-) diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 86c04dba..424f69b4 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -67,7 +67,7 @@ class Main { conclusionMap.get(result.status).push(result); if (result.status != Success && !bulk) Sys.exit(1); - Sys.sleep(bulk ? 0.01 : 0.2); + //Sys.sleep(bulk ? 0.01 : 0.2); } } Sys.println(getTestStatusBar(conclusionMap.get(Success).length, conclusionMap.get(Failure).length, conclusionMap.get(Skipped).length, conclusionMap.get(Unimplemented).length)); @@ -120,7 +120,7 @@ class Main { var unimplementedPercent = unimplemented / (successes + failures + skipped + unimplemented); var unimplementedWidth = MathTools.round(unimplementedPercent * consoleWidth); - var output = '╔${[for (_ in 0...consoleWidth + 2) '═'].join('')}╗\n'; + var output = '╔${[for (_ in 0...(successWidth + failureWidth + skippedWidth + unimplementedWidth) + 2) '═'].join('')}╗\n'; output += '║ $RESET$BOLD$GREEN_BACKGROUND'; for (_ in 0...successWidth) output += ' '; @@ -132,7 +132,7 @@ class Main { for (_ in 0...unimplementedWidth) output += ' '; output += '$RESET ║'; - output += '\n╚${[for (_ in 0...consoleWidth + 2) '═'].join('')}╝'; + output += '\n╚${[for (_ in 0...(successWidth + failureWidth + skippedWidth + unimplementedWidth) + 2) '═'].join('')}╝'; return output; } diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index 3d641ac0..8ca21e0b 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -3,50 +3,50 @@ package; import tests.*; final tests:Array> = [ - // BilateralFilterTests, - // BilinearInterpolationTests, - // CannyTests, - // CramerTests, - // GaussTests, - // GaussJordanTests, - // ImageHashingTests, - // KMeansTests, - // LaplaceTests, - // PerspectiveWarpTests, - // PerwittTests, - // RadixTests, - // RobertsCrossTests, - // SimpleHoughTests, - // SimpleLineDetectorTests, - // SobelTests, + BilateralFilterTests, + BilinearInterpolationTests, + CannyTests, + CramerTests, + GaussTests, + GaussJordanTests, + ImageHashingTests, + KMeansTests, + LaplaceTests, + PerspectiveWarpTests, + PerwittTests, + RadixTests, + RobertsCrossTests, + SimpleHoughTests, + SimpleLineDetectorTests, + SobelTests, Array2DTests, ByteArrayTests, - // CannyObjectTests, + CannyObjectTests, ColorTests, - // HistogramTests, - // ImageTests, - // ImageViewTests, - // Int16Point2DTests, - // IntPoint2DTests, - // ColorClusterTests, - // Line2DTests, - // Matrix2DTests, - // PixelTests, - // Point2DTests, - // Point3DTests, - // QueueTests, - // QueueCellTests, - // Ray2DTests, - // RectangleTests, - // PointTransformationPairTests, - // TransformationMatrix2DTests, - // UInt16Point2DTests, - // ImageIOTests, - // FormatImageExporterTests, - // FormatImageLoaderTests, - // VisionThreadTests, + HistogramTests, + ImageTests, + ImageViewTests, + Int16Point2DTests, + IntPoint2DTests, + ColorClusterTests, + Line2DTests, + Matrix2DTests, + PixelTests, + Point2DTests, + Point3DTests, + QueueTests, + QueueCellTests, + Ray2DTests, + RectangleTests, + PointTransformationPairTests, + TransformationMatrix2DTests, + UInt16Point2DTests, + ImageIOTests, + FormatImageExporterTests, + FormatImageLoaderTests, + VisionThreadTests, ArrayToolsTests, - // ImageToolsTests, - // MathToolsTests, + ImageToolsTests, + MathToolsTests, // VisionTests ]; \ No newline at end of file diff --git a/tests/generated/src/tests/IntPoint2DTests.hx b/tests/generated/src/tests/IntPoint2DTests.hx index 5261b2db..95d5f2b0 100644 --- a/tests/generated/src/tests/IntPoint2DTests.hx +++ b/tests/generated/src/tests/IntPoint2DTests.hx @@ -12,8 +12,8 @@ import haxe.Int64; class IntPoint2DTests { public static function vision_ds_IntPoint2D__x__ShouldWork():TestResult { try { - var x = 0; - var y = 0; + var x = 15; + var y = 12; var object = new vision.ds.IntPoint2D(x, y); var result = object.x; @@ -21,14 +21,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#x", returned: result, - expected: null, - status: Unimplemented + expected: 15, + status: TestStatus.of(result == 15) } } catch (e) { return { testName: "vision.ds.IntPoint2D#x", returned: e, - expected: null, + expected: 15, status: Failure } } @@ -37,7 +37,7 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__y__ShouldWork():TestResult { try { var x = 0; - var y = 0; + var y = 1000; var object = new vision.ds.IntPoint2D(x, y); var result = object.y; @@ -45,14 +45,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#y", returned: result, - expected: null, - status: Unimplemented + expected: 1000, + status: TestStatus.of(result == 1000) } } catch (e) { return { testName: "vision.ds.IntPoint2D#y", returned: e, - expected: null, + expected: 1000, status: Failure } } @@ -67,14 +67,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D.fromPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: new IntPoint2D(0, 0), + status: TestStatus.of([result.x, result.y], [0, 0]) } } catch (e) { return { testName: "vision.ds.IntPoint2D.fromPoint2D", returned: e, - expected: null, + expected: new IntPoint2D(0, 0), status: Failure } } @@ -92,14 +92,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#toPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: new Point2D(0, 0), + status: TestStatus.of([result.x, result.y], [0, 0]) } } catch (e) { return { testName: "vision.ds.IntPoint2D#toPoint2D", returned: e, - expected: null, + expected: new Point2D(0, 0), status: Failure } } @@ -107,8 +107,8 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__toString__String__ShouldWork():TestResult { try { - var x = 0; - var y = 0; + var x = 4; + var y = 5; var object = new vision.ds.IntPoint2D(x, y); @@ -117,14 +117,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#toString", returned: result, - expected: null, - status: Unimplemented + expected: "(4, 5)", + status: TestStatus.of(result == "(4, 5)") } } catch (e) { return { testName: "vision.ds.IntPoint2D#toString", returned: e, - expected: null, + expected: "(4, 5)", status: Failure } } @@ -132,8 +132,8 @@ class IntPoint2DTests { public static function vision_ds_IntPoint2D__copy__IntPoint2D__ShouldWork():TestResult { try { - var x = 0; - var y = 0; + var x = 505; + var y = 17; var object = new vision.ds.IntPoint2D(x, y); @@ -142,14 +142,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#copy", returned: result, - expected: null, - status: Unimplemented + expected: new IntPoint2D(505, 17), + status: TestStatus.of([result.x, result.y], [505, 17]) } } catch (e) { return { testName: "vision.ds.IntPoint2D#copy", returned: e, - expected: null, + expected: new IntPoint2D(505, 17), status: Failure } } @@ -160,7 +160,7 @@ class IntPoint2DTests { var x = 0; var y = 0; - var point = new vision.ds.IntPoint2D(0, 0); + var point = new vision.ds.IntPoint2D(1, 1); var object = new vision.ds.IntPoint2D(x, y); var result = object.distanceTo(point); @@ -168,14 +168,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#distanceTo", returned: result, - expected: null, - status: Unimplemented + expected: MathTools.SQRT2, + status: TestStatus.of(result == MathTools.SQRT2) } } catch (e) { return { testName: "vision.ds.IntPoint2D#distanceTo", returned: e, - expected: null, + expected: MathTools.SQRT2, status: Failure } } @@ -186,7 +186,7 @@ class IntPoint2DTests { var x = 0; var y = 0; - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(1, 2); var object = new vision.ds.IntPoint2D(x, y); var result = object.degreesTo(point); @@ -194,14 +194,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#degreesTo", returned: result, - expected: null, - status: Unimplemented + expected: 60, + status: TestStatus.of(result == 60) } } catch (e) { return { testName: "vision.ds.IntPoint2D#degreesTo", returned: e, - expected: null, + expected: 60, status: Failure } } @@ -212,7 +212,7 @@ class IntPoint2DTests { var x = 0; var y = 0; - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(1, 2); var object = new vision.ds.IntPoint2D(x, y); var result = object.radiansTo(point); @@ -220,14 +220,14 @@ class IntPoint2DTests { return { testName: "vision.ds.IntPoint2D#radiansTo", returned: result, - expected: null, - status: Unimplemented + expected: 60 * MathTools.PI / 180, + status: TestStatus.of(result == 60 * MathTools.PI / 180) } } catch (e) { return { testName: "vision.ds.IntPoint2D#radiansTo", returned: e, - expected: null, + expected: 60 * MathTools.PI / 180, status: Failure } } diff --git a/tests/generated/src/tests/Point2DTests.hx b/tests/generated/src/tests/Point2DTests.hx index 6638e360..8ca8c2c0 100644 --- a/tests/generated/src/tests/Point2DTests.hx +++ b/tests/generated/src/tests/Point2DTests.hx @@ -10,8 +10,8 @@ import vision.tools.MathTools; class Point2DTests { public static function vision_ds_Point2D__toString__String__ShouldWork():TestResult { try { - var x = 0.0; - var y = 0.0; + var x = 0.1; + var y = 0.2; var object = new vision.ds.Point2D(x, y); @@ -20,14 +20,14 @@ class Point2DTests { return { testName: "vision.ds.Point2D#toString", returned: result, - expected: null, - status: Unimplemented + expected: "(0.1, 0.2)", + status: TestStatus.of(result == "(0.1, 0.2)") } } catch (e) { return { testName: "vision.ds.Point2D#toString", returned: e, - expected: null, + expected: "(0.1, 0.2)", status: Failure } } @@ -35,8 +35,8 @@ class Point2DTests { public static function vision_ds_Point2D__copy__Point2D__ShouldWork():TestResult { try { - var x = 0.0; - var y = 0.0; + var x = 1.0; + var y = 0.1; var object = new vision.ds.Point2D(x, y); @@ -45,14 +45,14 @@ class Point2DTests { return { testName: "vision.ds.Point2D#copy", returned: result, - expected: null, - status: Unimplemented + expected: new Point2D(1, 0.1), + status: TestStatus.of([result.x, result.y], [1, 0.1]) } } catch (e) { return { testName: "vision.ds.Point2D#copy", returned: e, - expected: null, + expected: new Point2D(1, 0.1), status: Failure } } @@ -63,7 +63,7 @@ class Point2DTests { var x = 0.0; var y = 0.0; - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(1, 1); var object = new vision.ds.Point2D(x, y); var result = object.distanceTo(point); @@ -71,14 +71,14 @@ class Point2DTests { return { testName: "vision.ds.Point2D#distanceTo", returned: result, - expected: null, - status: Unimplemented + expected: MathTools.SQRT2, + status: TestStatus.of(result == MathTools.SQRT2) } } catch (e) { return { testName: "vision.ds.Point2D#distanceTo", returned: e, - expected: null, + expected: MathTools.SQRT2, status: Failure } } @@ -89,7 +89,7 @@ class Point2DTests { var x = 0.0; var y = 0.0; - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(2, 1); var object = new vision.ds.Point2D(x, y); var result = object.degreesTo(point); @@ -97,14 +97,14 @@ class Point2DTests { return { testName: "vision.ds.Point2D#degreesTo", returned: result, - expected: null, - status: Unimplemented + expected: 30, + status: TestStatus.of(result == 30) } } catch (e) { return { testName: "vision.ds.Point2D#degreesTo", returned: e, - expected: null, + expected: 30, status: Failure } } @@ -115,7 +115,7 @@ class Point2DTests { var x = 0.0; var y = 0.0; - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(2, 1); var object = new vision.ds.Point2D(x, y); var result = object.radiansTo(point); @@ -123,14 +123,14 @@ class Point2DTests { return { testName: "vision.ds.Point2D#radiansTo", returned: result, - expected: null, - status: Unimplemented + expected: 30 * MathTools.PI / 180, + status: TestStatus.of(result == 30 * MathTools.PI / 180) } } catch (e) { return { testName: "vision.ds.Point2D#radiansTo", returned: e, - expected: null, + expected: 30 * MathTools.PI / 180, status: Failure } } diff --git a/tests/generated/src/tests/Point3DTests.hx b/tests/generated/src/tests/Point3DTests.hx index 9cbaf677..69a6e07c 100644 --- a/tests/generated/src/tests/Point3DTests.hx +++ b/tests/generated/src/tests/Point3DTests.hx @@ -14,7 +14,7 @@ class Point3DTests { var y = 0.0; var z = 0.0; - var point:Point3D = null; + var point = new Point3D(1, 1, 1); var object = new vision.ds.Point3D(x, y, z); var result = object.distanceTo(point); @@ -22,14 +22,14 @@ class Point3DTests { return { testName: "vision.ds.Point3D#distanceTo", returned: result, - expected: null, - status: Unimplemented + expected: MathTools.SQRT3, + status: TestStatus.of(result == MathTools.SQRT3) } } catch (e) { return { testName: "vision.ds.Point3D#distanceTo", returned: e, - expected: null, + expected: MathTools.SQRT3, status: Failure } } @@ -37,9 +37,9 @@ class Point3DTests { public static function vision_ds_Point3D__copy__Point3D__ShouldWork():TestResult { try { - var x = 0.0; - var y = 0.0; - var z = 0.0; + var x = 0.1; + var y = 0.2; + var z = 0.3; var object = new vision.ds.Point3D(x, y, z); @@ -48,14 +48,14 @@ class Point3DTests { return { testName: "vision.ds.Point3D#copy", returned: result, - expected: null, - status: Unimplemented + expected: new Point3D(0.1, 0.2, 0.3), + status: TestStatus.of([result.x, result.y, result.z], [0.1, 0.2, 0.3]) } } catch (e) { return { testName: "vision.ds.Point3D#copy", returned: e, - expected: null, + expected: new Point3D(0.1, 0.2, 0.3), status: Failure } } @@ -63,9 +63,9 @@ class Point3DTests { public static function vision_ds_Point3D__toString__String__ShouldWork():TestResult { try { - var x = 0.0; - var y = 0.0; - var z = 0.0; + var x = 0.1; + var y = 0.2; + var z = 0.3; var object = new vision.ds.Point3D(x, y, z); @@ -74,18 +74,16 @@ class Point3DTests { return { testName: "vision.ds.Point3D#toString", returned: result, - expected: null, - status: Unimplemented + expected: "(0.1, 0.2, 0.3)", + status: TestStatus.of(result == "(0.1, 0.2, 0.3)") } } catch (e) { return { testName: "vision.ds.Point3D#toString", returned: e, - expected: null, + expected: "(0.1, 0.2, 0.3)", status: Failure } } } - - } \ No newline at end of file diff --git a/tests/generated/src/tests/UInt16Point2DTests.hx b/tests/generated/src/tests/UInt16Point2DTests.hx index 0f408297..8365c7a7 100644 --- a/tests/generated/src/tests/UInt16Point2DTests.hx +++ b/tests/generated/src/tests/UInt16Point2DTests.hx @@ -1,5 +1,7 @@ package tests; +import vision.ds.IntPoint2D; +import vision.ds.Point2D; import TestResult; import TestStatus; @@ -10,7 +12,7 @@ import vision.ds.UInt16Point2D; class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__x__ShouldWork():TestResult { try { - var X = 0; + var X = 15; var Y = 0; var object = new vision.ds.UInt16Point2D(X, Y); @@ -19,14 +21,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#x", returned: result, - expected: null, - status: Unimplemented + expected: 15, + status: TestStatus.of(result == 15) } } catch (e) { return { testName: "vision.ds.UInt16Point2D#x", returned: e, - expected: null, + expected: 15, status: Failure } } @@ -35,7 +37,7 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__y__ShouldWork():TestResult { try { var X = 0; - var Y = 0; + var Y = 87; var object = new vision.ds.UInt16Point2D(X, Y); var result = object.y; @@ -43,14 +45,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#y", returned: result, - expected: null, - status: Unimplemented + expected: 87, + status: TestStatus.of(result == 87) } } catch (e) { return { testName: "vision.ds.UInt16Point2D#y", returned: e, - expected: null, + expected: 87, status: Failure } } @@ -58,8 +60,8 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toString__String__ShouldWork():TestResult { try { - var X = 0; - var Y = 0; + var X = 12; + var Y = -1; var object = new vision.ds.UInt16Point2D(X, Y); @@ -68,14 +70,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#toString", returned: result, - expected: null, - status: Unimplemented + expected: "(12, 65535)", + status: TestStatus.of(result == "(12, 65535)") } } catch (e) { return { testName: "vision.ds.UInt16Point2D#toString", returned: e, - expected: null, + expected: "(12, 65535)", status: Failure } } @@ -83,8 +85,8 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toPoint2D__Point2D__ShouldWork():TestResult { try { - var X = 0; - var Y = 0; + var X = 5; + var Y = 7; var object = new vision.ds.UInt16Point2D(X, Y); @@ -93,14 +95,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#toPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: new Point2D(5, 7), + status: TestStatus.of([result.x, result.y], [5, 7]) } } catch (e) { return { testName: "vision.ds.UInt16Point2D#toPoint2D", returned: e, - expected: null, + expected: new Point2D(5, 7), status: Failure } } @@ -108,8 +110,8 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toIntPoint2D__Point2D__ShouldWork():TestResult { try { - var X = 0; - var Y = 0; + var X = 6; + var Y = 6; var object = new vision.ds.UInt16Point2D(X, Y); @@ -118,14 +120,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#toIntPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: new IntPoint2D(6, 6), + status: TestStatus.of([result.x, result.y], [6, 6]) } } catch (e) { return { testName: "vision.ds.UInt16Point2D#toIntPoint2D", returned: e, - expected: null, + expected: new IntPoint2D(6, 6), status: Failure } } @@ -133,8 +135,8 @@ class UInt16Point2DTests { public static function vision_ds_UInt16Point2D__toInt__Int__ShouldWork():TestResult { try { - var X = 0; - var Y = 0; + var X = 1; + var Y = 1; var object = new vision.ds.UInt16Point2D(X, Y); @@ -143,14 +145,14 @@ class UInt16Point2DTests { return { testName: "vision.ds.UInt16Point2D#toInt", returned: result, - expected: null, - status: Unimplemented + expected: 0x00010001, + status: TestStatus.of(result == 0x00010001) } } catch (e) { return { testName: "vision.ds.UInt16Point2D#toInt", returned: e, - expected: null, + expected: 0x00010001, status: Failure } } From 3d660d9f401146391d0bde0b9237a916c42dd2c0 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:37:21 +0300 Subject: [PATCH 30/32] Some tests for MathTools --- tests/generated/src/tests/MathToolsTests.hx | 148 ++++++++++---------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index aa1cee34..efe22eb3 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -21,14 +21,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.PI", returned: result, - expected: null, - status: Unimplemented + expected: Math.PI, + status: TestStatus.of(result == Math.PI) } } catch (e) { return { testName: "vision.tools.MathTools.PI", returned: e, - expected: null, + expected: Math.PI, status: Failure } } @@ -41,14 +41,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.PI_OVER_2", returned: result, - expected: null, - status: Unimplemented + expected: Math.PI / 2, + status: TestStatus.of(result == Math.PI / 2) } } catch (e) { return { testName: "vision.tools.MathTools.PI_OVER_2", returned: e, - expected: null, + expected: Math.PI / 2, status: Failure } } @@ -61,14 +61,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.NEGATIVE_INFINITY", returned: result, - expected: null, - status: Unimplemented + expected: Math.NEGATIVE_INFINITY, + status: TestStatus.of(result == Math.NEGATIVE_INFINITY) } } catch (e) { return { testName: "vision.tools.MathTools.NEGATIVE_INFINITY", returned: e, - expected: null, + expected: Math.NEGATIVE_INFINITY, status: Failure } } @@ -81,14 +81,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.POSITIVE_INFINITY", returned: result, - expected: null, - status: Unimplemented + expected: Math.POSITIVE_INFINITY, + status: TestStatus.of(result == Math.POSITIVE_INFINITY) } } catch (e) { return { testName: "vision.tools.MathTools.POSITIVE_INFINITY", returned: e, - expected: null, + expected: Math.POSITIVE_INFINITY, status: Failure } } @@ -101,14 +101,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.NaN", returned: result, - expected: null, - status: Unimplemented + expected: Math.NaN, + status: TestStatus.of(Math.isNaN(result)) } } catch (e) { return { testName: "vision.tools.MathTools.NaN", returned: e, - expected: null, + expected: Math.NaN, status: Failure } } @@ -121,14 +121,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.SQRT2", returned: result, - expected: null, - status: Unimplemented + expected: Math.sqrt(2), + status: TestStatus.of(result == Math.sqrt(2)) } } catch (e) { return { testName: "vision.tools.MathTools.SQRT2", returned: e, - expected: null, + expected: Math.sqrt(2), status: Failure } } @@ -141,14 +141,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.SQRT3", returned: result, - expected: null, - status: Unimplemented + expected: Math.sqrt(3), + status: TestStatus.of(result == Math.sqrt(3)) } } catch (e) { return { testName: "vision.tools.MathTools.SQRT3", returned: e, - expected: null, + expected: Math.sqrt(3), status: Failure } } @@ -1354,21 +1354,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cotan_Float_Float__ShouldWork():TestResult { try { - var radians = 0.0; + var radians = 6; var result = vision.tools.MathTools.cotan(radians); return { testName: "vision.tools.MathTools.cotan", returned: result, - expected: null, - status: Unimplemented + expected: Math.cos(6) / Math.sin(6), + status: TestStatus.of(result == Math.cos(6) / Math.sin(6)) } } catch (e) { return { testName: "vision.tools.MathTools.cotan", returned: e, - expected: null, + expected: Math.cos(6) / Math.sin(6), status: Failure } } @@ -1376,21 +1376,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cosec_Float_Float__ShouldWork():TestResult { try { - var radians = 0.0; + var radians = 5; var result = vision.tools.MathTools.cosec(radians); return { testName: "vision.tools.MathTools.cosec", returned: result, - expected: null, - status: Unimplemented + expected: 1 / Math.sin(5), + status: TestStatus.of(result == 1 / Math.sin(5)) } } catch (e) { return { testName: "vision.tools.MathTools.cosec", returned: e, - expected: null, + expected: 1 / Math.sin(5), status: Failure } } @@ -1398,21 +1398,21 @@ class MathToolsTests { public static function vision_tools_MathTools__sec_Float_Float__ShouldWork():TestResult { try { - var radians = 0.0; + var radians = 5; var result = vision.tools.MathTools.sec(radians); return { testName: "vision.tools.MathTools.sec", returned: result, - expected: null, - status: Unimplemented + expected: 1 / Math.cos(5), + status: TestStatus.of(result == 1 / Math.cos(5)) } } catch (e) { return { testName: "vision.tools.MathTools.sec", returned: e, - expected: null, + expected: 1 / Math.cos(5), status: Failure } } @@ -1420,21 +1420,21 @@ class MathToolsTests { public static function vision_tools_MathTools__sind_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 30; var result = vision.tools.MathTools.sind(degrees); return { testName: "vision.tools.MathTools.sind", returned: result, - expected: null, - status: Unimplemented + expected: Math.sin(30 * Math.PI / 180), + status: TestStatus.of(result == Math.sin(30 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.sind", returned: e, - expected: null, + expected: Math.sin(30 * Math.PI / 180), status: Failure } } @@ -1442,21 +1442,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cosd_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 30; var result = vision.tools.MathTools.cosd(degrees); return { testName: "vision.tools.MathTools.cosd", returned: result, - expected: null, - status: Unimplemented + expected: Math.cos(30 * Math.PI / 180), + status: TestStatus.of(result == Math.cos(30 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.cosd", returned: e, - expected: null, + expected: Math.cos(30 * Math.PI / 180), status: Failure } } @@ -1464,21 +1464,21 @@ class MathToolsTests { public static function vision_tools_MathTools__tand_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 6; var result = vision.tools.MathTools.tand(degrees); return { testName: "vision.tools.MathTools.tand", returned: result, - expected: null, - status: Unimplemented + expected: Math.tan(6 * Math.PI / 180), + status: TestStatus.of(result == Math.tan(6 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.tand", returned: e, - expected: null, + expected: Math.tan(6 * Math.PI / 180), status: Failure } } @@ -1486,21 +1486,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cotand_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 4; var result = vision.tools.MathTools.cotand(degrees); return { testName: "vision.tools.MathTools.cotand", returned: result, - expected: null, - status: Unimplemented + expected: Math.cos(4 * Math.PI / 180) / Math.sin(4 * Math.PI / 180), + status: TestStatus.of(result == Math.cos(4 * Math.PI / 180) / Math.sin(4 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.cotand", returned: e, - expected: null, + expected: Math.cos(4 * Math.PI / 180) / Math.sin(4 * Math.PI / 180), status: Failure } } @@ -1508,21 +1508,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cosecd_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 40; var result = vision.tools.MathTools.cosecd(degrees); return { testName: "vision.tools.MathTools.cosecd", returned: result, - expected: null, - status: Unimplemented + expected: 1 / Math.sin(40 * Math.PI / 180), + status: TestStatus.of(result == 1 / Math.sin(40 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.cosecd", returned: e, - expected: null, + expected: 1 / Math.sin(40 * Math.PI / 180), status: Failure } } @@ -1530,21 +1530,21 @@ class MathToolsTests { public static function vision_tools_MathTools__secd_Float_Float__ShouldWork():TestResult { try { - var degrees = 0.0; + var degrees = 40; var result = vision.tools.MathTools.secd(degrees); return { testName: "vision.tools.MathTools.secd", returned: result, - expected: null, - status: Unimplemented + expected: 1 / Math.cos(40 * Math.PI / 180), + status: TestStatus.of(result == 1 / Math.cos(40 * Math.PI / 180)) } } catch (e) { return { testName: "vision.tools.MathTools.secd", returned: e, - expected: null, + expected: 1 / Math.cos(40 * Math.PI / 180), status: Failure } } @@ -1552,22 +1552,22 @@ class MathToolsTests { public static function vision_tools_MathTools__truncate_Float_Int_Float__ShouldWork():TestResult { try { - var num = 0.0; - var numbersAfterDecimal = 0; + var num = 3.141592653589793; + var numbersAfterDecimal = 2; var result = vision.tools.MathTools.truncate(num, numbersAfterDecimal); return { testName: "vision.tools.MathTools.truncate", returned: result, - expected: null, - status: Unimplemented + expected: 3.14, + status: TestStatus.of(result == 3.14) } } catch (e) { return { testName: "vision.tools.MathTools.truncate", returned: e, - expected: null, + expected: 3.14, status: Failure } } @@ -1575,21 +1575,21 @@ class MathToolsTests { public static function vision_tools_MathTools__cropDecimal_Float_Int__ShouldWork():TestResult { try { - var number = 0.0; + var number = 3.141592653589793; var result = vision.tools.MathTools.cropDecimal(number); return { testName: "vision.tools.MathTools.cropDecimal", returned: result, - expected: null, - status: Unimplemented + expected: 3, + status: TestStatus.of(result == 3) } } catch (e) { return { testName: "vision.tools.MathTools.cropDecimal", returned: e, - expected: null, + expected: 3, status: Failure } } @@ -1597,21 +1597,21 @@ class MathToolsTests { public static function vision_tools_MathTools__isInt_Float_Bool__ShouldWork():TestResult { try { - var v = 0.0; + var v = 0.1; var result = vision.tools.MathTools.isInt(v); return { testName: "vision.tools.MathTools.isInt", returned: result, - expected: null, - status: Unimplemented + expected: false, + status: TestStatus.of(result == false) } } catch (e) { return { testName: "vision.tools.MathTools.isInt", returned: e, - expected: null, + expected: false, status: Failure } } @@ -1641,21 +1641,21 @@ class MathToolsTests { public static function vision_tools_MathTools__parseBool_String_Bool__ShouldWork():TestResult { try { - var s = ""; + var s = "true"; var result = vision.tools.MathTools.parseBool(s); return { testName: "vision.tools.MathTools.parseBool", returned: result, - expected: null, - status: Unimplemented + expected: true, + status: TestStatus.of(result == true) } } catch (e) { return { testName: "vision.tools.MathTools.parseBool", returned: e, - expected: null, + expected: true, status: Failure } } From b146b7fb4eee269c984c05e53307e48e1488aff1 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Sun, 29 Jun 2025 20:17:05 +0300 Subject: [PATCH 31/32] More tests... --- tests/generated/src/Main.hx | 1 - tests/generated/src/TestConclusion.hx | 5 -- tests/generated/src/TestsToRun.hx | 6 -- tests/generated/src/tests/CannyObjectTests.hx | 12 --- .../generated/src/tests/ColorClusterTests.hx | 12 --- tests/generated/src/tests/ImageIOTests.hx | 13 --- tests/generated/src/tests/MathToolsTests.hx | 87 +++++++++---------- tests/generated/src/tests/Matrix2DTests.hx | 8 +- tests/generated/src/tests/PixelTests.hx | 12 --- .../src/tests/PointTransformationPairTests.hx | 12 --- tests/generated/src/tests/RectangleTests.hx | 12 --- 11 files changed, 47 insertions(+), 133 deletions(-) delete mode 100644 tests/generated/src/TestConclusion.hx delete mode 100644 tests/generated/src/tests/CannyObjectTests.hx delete mode 100644 tests/generated/src/tests/ColorClusterTests.hx delete mode 100644 tests/generated/src/tests/ImageIOTests.hx delete mode 100644 tests/generated/src/tests/PixelTests.hx delete mode 100644 tests/generated/src/tests/PointTransformationPairTests.hx delete mode 100644 tests/generated/src/tests/RectangleTests.hx diff --git a/tests/generated/src/Main.hx b/tests/generated/src/Main.hx index 424f69b4..f207a05f 100644 --- a/tests/generated/src/Main.hx +++ b/tests/generated/src/Main.hx @@ -10,7 +10,6 @@ using vision.tools.ArrayTools; import TestStatus; import TestResult; -import TestConclusion; import TestsToRun; class Main { diff --git a/tests/generated/src/TestConclusion.hx b/tests/generated/src/TestConclusion.hx deleted file mode 100644 index 7a3a6819..00000000 --- a/tests/generated/src/TestConclusion.hx +++ /dev/null @@ -1,5 +0,0 @@ -package; - -typedef TestConclusion = TestResult & { - testNumber:Int, -} \ No newline at end of file diff --git a/tests/generated/src/TestsToRun.hx b/tests/generated/src/TestsToRun.hx index 8ca21e0b..f3771ffe 100644 --- a/tests/generated/src/TestsToRun.hx +++ b/tests/generated/src/TestsToRun.hx @@ -21,27 +21,21 @@ final tests:Array> = [ SobelTests, Array2DTests, ByteArrayTests, - CannyObjectTests, ColorTests, HistogramTests, ImageTests, ImageViewTests, Int16Point2DTests, IntPoint2DTests, - ColorClusterTests, Line2DTests, Matrix2DTests, - PixelTests, Point2DTests, Point3DTests, QueueTests, QueueCellTests, Ray2DTests, - RectangleTests, - PointTransformationPairTests, TransformationMatrix2DTests, UInt16Point2DTests, - ImageIOTests, FormatImageExporterTests, FormatImageLoaderTests, VisionThreadTests, diff --git a/tests/generated/src/tests/CannyObjectTests.hx b/tests/generated/src/tests/CannyObjectTests.hx deleted file mode 100644 index 0ae9cd98..00000000 --- a/tests/generated/src/tests/CannyObjectTests.hx +++ /dev/null @@ -1,12 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.canny.CannyObject; - - -@:access(vision.ds.canny.CannyObject) -class CannyObjectTests { - -} \ No newline at end of file diff --git a/tests/generated/src/tests/ColorClusterTests.hx b/tests/generated/src/tests/ColorClusterTests.hx deleted file mode 100644 index b2cc2dfd..00000000 --- a/tests/generated/src/tests/ColorClusterTests.hx +++ /dev/null @@ -1,12 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.kmeans.ColorCluster; - - -@:access(vision.ds.kmeans.ColorCluster) -class ColorClusterTests { - -} \ No newline at end of file diff --git a/tests/generated/src/tests/ImageIOTests.hx b/tests/generated/src/tests/ImageIOTests.hx deleted file mode 100644 index a47d3ee8..00000000 --- a/tests/generated/src/tests/ImageIOTests.hx +++ /dev/null @@ -1,13 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.formats.ImageIO; -import vision.formats.from.From; -import vision.formats.to.To; - -@:access(vision.formats.ImageIO) -class ImageIOTests { - -} \ No newline at end of file diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index efe22eb3..2f0e82eb 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -156,22 +156,22 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromRayToPoint2D_Ray2D_Point2D_Float__ShouldWork():TestResult { try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var point = new vision.ds.Point2D(0, 0); + var ray = new vision.ds.Ray2D({x: 0, y: 5}, 2); + var point = new vision.ds.Point2D(5, 6); var result = vision.tools.MathTools.distanceFromRayToPoint2D(ray, point); return { testName: "vision.tools.MathTools.distanceFromRayToPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: 4.0249223594996213, + status: TestStatus.of(result == 4.0249223594996213) } } catch (e) { return { testName: "vision.tools.MathTools.distanceFromRayToPoint2D", returned: e, - expected: null, + expected: 4.0249223594996213, status: Failure } } @@ -179,22 +179,22 @@ class MathToolsTests { public static function vision_tools_MathTools__intersectionBetweenRay2Ds_Ray2D_Ray2D_Point2D__ShouldWork():TestResult { try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray = new vision.ds.Ray2D({x: 0, y: 5}, 2); + var ray2 = new vision.ds.Ray2D({x: 0, y: -6}, 1); var result = vision.tools.MathTools.intersectionBetweenRay2Ds(ray, ray2); return { testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", returned: result, - expected: null, - status: Unimplemented + expected: new Point2D(-11, -17), + status: TestStatus.of([result.x, result.y] == [-11, -17]) } } catch (e) { return { testName: "vision.tools.MathTools.intersectionBetweenRay2Ds", returned: e, - expected: null, + expected: new Point2D(-11, -17), status: Failure } } @@ -202,22 +202,22 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceBetweenRays2D_Ray2D_Ray2D_Float__ShouldWork():TestResult { try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var ray2 = new vision.ds.Ray2D({x: 0, y: 0}, 1); + var ray = new vision.ds.Ray2D({x: 0, y: 5}, 2); + var ray2 = new vision.ds.Ray2D({x: 0, y: 10}, 2); var result = vision.tools.MathTools.distanceBetweenRays2D(ray, ray2); return { testName: "vision.tools.MathTools.distanceBetweenRays2D", returned: result, - expected: null, - status: Unimplemented + expected: Math.sqrt(5), + status: TestStatus.of(result == Math.sqrt(5)) } } catch (e) { return { testName: "vision.tools.MathTools.distanceBetweenRays2D", returned: e, - expected: null, + expected: Math.sqrt(5), status: Failure } } @@ -225,24 +225,23 @@ class MathToolsTests { public static function vision_tools_MathTools__findPointAtDistanceUsingX_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var startXPos = 0.0; - var distance = 0.0; - var goPositive = false; + var ray = new vision.ds.Ray2D({x: 0, y: 12}, 0.5); + var startXPos = 6; + var distance = 10; - var result = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, goPositive); - + var result1 = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, true); + var result2 = vision.tools.MathTools.findPointAtDistanceUsingX(ray, startXPos, distance, false); return { testName: "vision.tools.MathTools.findPointAtDistanceUsingX", - returned: result, - expected: null, - status: Unimplemented + returned: '${result1}, then: ${result2}', + expected: '${new Point2D(6 + 4 * Math.sqrt(5), 15 + 2 * Math.sqrt(5))}, then: ${new Point2D(6 - 4 * Math.sqrt(5), 15 - 2 * Math.sqrt(5))}', + status: Skipped } } catch (e) { return { testName: "vision.tools.MathTools.findPointAtDistanceUsingX", returned: e, - expected: null, + expected: '${new Point2D(6 + 4 * Math.sqrt(5), 15 + 2 * Math.sqrt(5))}, then: ${new Point2D(6 - 4 * Math.sqrt(5), 15 - 2 * Math.sqrt(5))}', status: Failure } } @@ -250,24 +249,24 @@ class MathToolsTests { public static function vision_tools_MathTools__findPointAtDistanceUsingY_Ray2D_Float_Float_Bool_Point2D__ShouldWork():TestResult { try { - var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); - var startYPos = 0.0; - var distance = 0.0; - var goPositive = false; + var ray = new vision.ds.Ray2D({x: 0, y: 12}, 0.5); + var startYPos = 15; + var distance = 10; - var result = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, goPositive); - + var result1 = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, true); + var result2 = vision.tools.MathTools.findPointAtDistanceUsingY(ray, startYPos, distance, false); + return { testName: "vision.tools.MathTools.findPointAtDistanceUsingY", - returned: result, - expected: null, - status: Unimplemented + returned: '${result1}, then: ${result2}', + expected: '${new Point2D(6 + 4 * Math.sqrt(5), 15 + 2 * Math.sqrt(5))}, then: ${new Point2D(6 - 4 * Math.sqrt(5), 15 - 2 * Math.sqrt(5))}', + status: Skipped } } catch (e) { return { testName: "vision.tools.MathTools.findPointAtDistanceUsingY", returned: e, - expected: null, + expected: '${new Point2D(6 + 4 * Math.sqrt(5), 15 + 2 * Math.sqrt(5))}, then: ${new Point2D(6 - 4 * Math.sqrt(5), 15 - 2 * Math.sqrt(5))}', status: Failure } } @@ -276,7 +275,7 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(40, 20); var result = vision.tools.MathTools.distanceFromLineToPoint2D(line, point); @@ -298,7 +297,7 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceBetweenLines2D_Line2D_Line2D_Float__ShouldWork():TestResult { try { - var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line1 = new vision.ds.Line2D({x: 11, y: 11}, {x: 20, y: 20}); var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var result = vision.tools.MathTools.distanceBetweenLines2D(line1, line2); @@ -306,14 +305,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.distanceBetweenLines2D", returned: result, - expected: null, - status: Unimplemented + expected: Math.sqrt(2), + status: TestStatus.of(result == Math.sqrt(2)) } } catch (e) { return { testName: "vision.tools.MathTools.distanceBetweenLines2D", returned: e, - expected: null, + expected: Math.sqrt(2), status: Failure } } @@ -322,21 +321,21 @@ class MathToolsTests { public static function vision_tools_MathTools__radiansFromLineToPoint2D_Line2D_Point2D_Float__ShouldWork():TestResult { try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(40, 20); var result = vision.tools.MathTools.radiansFromLineToPoint2D(line, point); return { testName: "vision.tools.MathTools.radiansFromLineToPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: Math.atan2(10, 30), + status: TestStatus.of(result == Math.atan2(10, 30)) } } catch (e) { return { testName: "vision.tools.MathTools.radiansFromLineToPoint2D", returned: e, - expected: null, + expected: Math.atan2(10, 30), status: Failure } } diff --git a/tests/generated/src/tests/Matrix2DTests.hx b/tests/generated/src/tests/Matrix2DTests.hx index 10f8d11d..d024d2f7 100644 --- a/tests/generated/src/tests/Matrix2DTests.hx +++ b/tests/generated/src/tests/Matrix2DTests.hx @@ -15,8 +15,8 @@ import vision.tools.MathTools.*; class Matrix2DTests { public static function vision_ds_Matrix2D__underlying__ShouldWork():TestResult { try { - var width = 0; - var height = 0; + var width = 2; + var height = 2; var object = new vision.ds.Matrix2D(width, height); var result = object.underlying; @@ -24,8 +24,8 @@ class Matrix2DTests { return { testName: "vision.ds.Matrix2D#underlying", returned: result, - expected: null, - status: Unimplemented + expected: new Array2D(width, height, 2), + status: TestStatus.of(result, new Array2D(width, height, 0)) } } catch (e) { return { diff --git a/tests/generated/src/tests/PixelTests.hx b/tests/generated/src/tests/PixelTests.hx deleted file mode 100644 index 6b33b08c..00000000 --- a/tests/generated/src/tests/PixelTests.hx +++ /dev/null @@ -1,12 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.Pixel; - - -@:access(vision.ds.Pixel) -class PixelTests { - -} \ No newline at end of file diff --git a/tests/generated/src/tests/PointTransformationPairTests.hx b/tests/generated/src/tests/PointTransformationPairTests.hx deleted file mode 100644 index 25e80baf..00000000 --- a/tests/generated/src/tests/PointTransformationPairTests.hx +++ /dev/null @@ -1,12 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.specifics.PointTransformationPair; - - -@:access(vision.ds.specifics.PointTransformationPair) -class PointTransformationPairTests { - -} \ No newline at end of file diff --git a/tests/generated/src/tests/RectangleTests.hx b/tests/generated/src/tests/RectangleTests.hx deleted file mode 100644 index da998fc6..00000000 --- a/tests/generated/src/tests/RectangleTests.hx +++ /dev/null @@ -1,12 +0,0 @@ -package tests; - -import TestResult; -import TestStatus; - -import vision.ds.Rectangle; - - -@:access(vision.ds.Rectangle) -class RectangleTests { - -} \ No newline at end of file From 2ef9058731076bd3cbd0177dfe152e3617e551b6 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Fri, 21 Nov 2025 20:31:25 +0200 Subject: [PATCH 32/32] Some more tests --- tests/generated/src/tests/MathToolsTests.hx | 60 ++++++++++----------- tests/generated/src/tests/RadixTests.hx | 24 ++++----- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/generated/src/tests/MathToolsTests.hx b/tests/generated/src/tests/MathToolsTests.hx index 2f0e82eb..d3d7eed4 100644 --- a/tests/generated/src/tests/MathToolsTests.hx +++ b/tests/generated/src/tests/MathToolsTests.hx @@ -282,14 +282,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.distanceFromLineToPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: 31.622776601684, + status: TestStatus.of(result == 31.622776601684) } } catch (e) { return { testName: "vision.tools.MathTools.distanceFromLineToPoint2D", returned: e, - expected: null, + expected: 31.622776601684, status: Failure } } @@ -344,21 +344,21 @@ class MathToolsTests { public static function vision_tools_MathTools__intersectionBetweenLine2Ds_Line2D_Line2D_Point2D__ShouldWork():TestResult { try { var line1 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var line2 = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var line2 = new vision.ds.Line2D({x: 0, y: 10}, {x: 10, y: 0}); var result = vision.tools.MathTools.intersectionBetweenLine2Ds(line1, line2); return { testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", returned: result, - expected: null, - status: Unimplemented + expected: new Point2D(5, 5), + status: TestStatus.of([result.x, result.y], [5, 5]) } } catch (e) { return { testName: "vision.tools.MathTools.intersectionBetweenLine2Ds", returned: e, - expected: null, + expected: new Point2D(5, 5), status: Failure } } @@ -367,21 +367,21 @@ class MathToolsTests { public static function vision_tools_MathTools__mirrorInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var rect:Rectangle = {x: 0, y: 0, width: 10, height: 10}; var result = vision.tools.MathTools.mirrorInsideRectangle(line, rect); return { testName: "vision.tools.MathTools.mirrorInsideRectangle", returned: result, - expected: null, - status: Unimplemented + expected: new Line2D({x: 0, y: 10}, {x: 10, y: 0}), + status: TestStatus.of(result, new Line2D({x: 0, y: 10}, {x: 10, y: 0})) } } catch (e) { return { testName: "vision.tools.MathTools.mirrorInsideRectangle", returned: e, - expected: null, + expected: new Line2D({x: 0, y: 10}, {x: 10, y: 0}), status: Failure } } @@ -389,22 +389,22 @@ class MathToolsTests { public static function vision_tools_MathTools__flipInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { try { - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var line = new vision.ds.Line2D({x: 2, y: 1}, {x: 8, y: 1}); + var rect:Rectangle = {x: 0, y: 0, width: 10, height: 10}; var result = vision.tools.MathTools.flipInsideRectangle(line, rect); return { testName: "vision.tools.MathTools.flipInsideRectangle", returned: result, - expected: null, - status: Unimplemented + expected: new Line2D({x: 2, y: 9}, {x: 8, y: 9}), + status: TestStatus.of(result, new Line2D({x: 2, y: 9}, {x: 8, y: 9})) } } catch (e) { return { testName: "vision.tools.MathTools.flipInsideRectangle", returned: e, - expected: null, + expected: new Line2D({x: 2, y: 9}, {x: 8, y: 9}), status: Failure } } @@ -413,21 +413,21 @@ class MathToolsTests { public static function vision_tools_MathTools__invertInsideRectangle_Line2D_Rectangle_Line2D__ShouldWork():TestResult { try { var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); - var rect:Rectangle = null; + var rect:Rectangle = {x: 0, y: 0, width: 20, height: 20}; var result = vision.tools.MathTools.invertInsideRectangle(line, rect); return { testName: "vision.tools.MathTools.invertInsideRectangle", returned: result, - expected: null, - status: Unimplemented + expected: new Line2D({x: 10, y: 10}, {x: 20, y: 20}), + status: TestStatus.of(result, new Line2D({x: 10, y: 10}, {x: 20, y: 20})) } } catch (e) { return { testName: "vision.tools.MathTools.invertInsideRectangle", returned: e, - expected: null, + expected: new Line2D({x: 10, y: 10}, {x: 20, y: 20}), status: Failure } } @@ -435,7 +435,7 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromPointToRay2D_Point2D_Ray2D_Float__ShouldWork():TestResult { try { - var point = new vision.ds.Point2D(0, 0); + var point = new vision.ds.Point2D(Math.sqrt(2), 0); var ray = new vision.ds.Ray2D({x: 0, y: 0}, 1); var result = vision.tools.MathTools.distanceFromPointToRay2D(point, ray); @@ -443,14 +443,14 @@ class MathToolsTests { return { testName: "vision.tools.MathTools.distanceFromPointToRay2D", returned: result, - expected: null, - status: Unimplemented + expected: 1, + status: TestStatus.of(result, 1) } } catch (e) { return { testName: "vision.tools.MathTools.distanceFromPointToRay2D", returned: e, - expected: null, + expected: 1, status: Failure } } @@ -458,22 +458,22 @@ class MathToolsTests { public static function vision_tools_MathTools__distanceFromPointToLine2D_Point2D_Line2D_Float__ShouldWork():TestResult { try { - var point = new vision.ds.Point2D(0, 0); - var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); + var point = new vision.ds.Point2D(40, 20); + var line = new vision.ds.Line2D({x: 0, y: 0}, {x: 10, y: 10}); var result = vision.tools.MathTools.distanceFromPointToLine2D(point, line); return { - testName: "vision.tools.MathTools.distanceFromPointToLine2D", + testName: "vision.tools.MathTools.distanceFromLineToPoint2D", returned: result, - expected: null, - status: Unimplemented + expected: 31.622776601684, + status: TestStatus.of(result == 31.622776601684) } } catch (e) { return { testName: "vision.tools.MathTools.distanceFromPointToLine2D", returned: e, - expected: null, + expected: 31.622776601684, status: Failure } } diff --git a/tests/generated/src/tests/RadixTests.hx b/tests/generated/src/tests/RadixTests.hx index 5b9ebc14..fc5c431f 100644 --- a/tests/generated/src/tests/RadixTests.hx +++ b/tests/generated/src/tests/RadixTests.hx @@ -12,21 +12,21 @@ import haxe.Int64; class RadixTests { public static function vision_algorithms_Radix__sort_ArrayInt_ArrayInt__ShouldWork():TestResult { try { - var main = []; + var main = [-23, 32, 0, 2341, -55, 324350135, -2349512]; var result = vision.algorithms.Radix.sort(main); return { testName: "vision.algorithms.Radix.sort", returned: result, - expected: null, - status: Unimplemented + expected: [-2349512, -55, -23, 0, 32, 2341, 324350135], + status: TestStatus.of(result, [-2349512, -55, -23, 0, 32, 2341, 324350135]) } } catch (e) { return { testName: "vision.algorithms.Radix.sort", returned: e, - expected: null, + expected: [-2349512, -55, -23, 0, 32, 2341, 324350135], status: Failure } } @@ -34,21 +34,21 @@ class RadixTests { public static function vision_algorithms_Radix__sort_ArrayUInt_ArrayUInt__ShouldWork():TestResult { try { - var main = []; + var main:Array = [0, 123, 5, 432, 7, 9, 1234]; var result = vision.algorithms.Radix.sort(main); return { testName: "vision.algorithms.Radix.sort", returned: result, - expected: null, - status: Unimplemented + expected: [0, 5, 7, 9, 123, 1234, 432], + status: TestStatus.of(result, [0, 5, 7, 9, 123, 1234, 432]) } } catch (e) { return { testName: "vision.algorithms.Radix.sort", returned: e, - expected: null, + expected: [0, 5, 7, 9, 123, 1234, 432], status: Failure } } @@ -56,21 +56,21 @@ class RadixTests { public static function vision_algorithms_Radix__sort_ArrayInt64_ArrayInt64__ShouldWork():TestResult { try { - var main = []; + var main:Array = [0, 32403258122i64, -532874197498234i64, 235981, -352, -4, 214]; var result = vision.algorithms.Radix.sort(main); return { testName: "vision.algorithms.Radix.sort", returned: result, - expected: null, - status: Unimplemented + expected: [-532874197498234i64, -352, -4, 0, 214, 235981, 32403258122i64], + status: TestStatus.of(result, [-532874197498234i64, -352, -4, 0, 214, 235981, 32403258122i64]) } } catch (e) { return { testName: "vision.algorithms.Radix.sort", returned: e, - expected: null, + expected: [-532874197498234i64, -352, -4, 0, 214, 235981, 32403258122i64], status: Failure } }