Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mandelbrot Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZETOUT Yasmine
Mandelbrot Template
Commits
6c238f65
Commit
6c238f65
authored
1 year ago
by
LABOUREL Arnaud
Browse files
Options
Downloads
Patches
Plain Diff
Update 2023
parent
fbf0dac7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+7
-74
7 additions, 74 deletions
.gitignore
build.gradle
+5
-5
5 additions, 5 deletions
build.gradle
src/test/java/mandelbrot/ComplexTest.java
+17
-1
17 additions, 1 deletion
src/test/java/mandelbrot/ComplexTest.java
with
29 additions
and
80 deletions
.gitignore
+
7
−
74
View file @
6c238f65
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
.gradle/
.idea/
idea/
build/
*.iml
*.ipr
*.iws
# IntelliJ
gradle/wrapper/gradle-wrapper.jar
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
This diff is collapsed.
Click to expand it.
build.gradle
+
5
−
5
View file @
6c238f65
plugins
{
id
'application'
id
"org.openjfx.javafxplugin"
version
"0.0.1
3
"
id
"org.openjfx.javafxplugin"
version
"0.0.1
4
"
}
sourceCompatibility
=
JavaVersion
.
VERSION_17
...
...
@@ -10,7 +10,7 @@ group 'M2_DLAD_AMU'
version
'0.1-SNAPSHOT'
javafx
{
version
=
"
18.0.
2"
version
=
"2
0
"
modules
=
[
'javafx.controls'
,
'javafx.fxml'
]
}
...
...
@@ -19,9 +19,9 @@ repositories {
}
dependencies
{
testImplementation
(
'org.junit.jupiter:junit-jupiter-api:5.
9
.0'
,
'org.assertj:assertj-core:3.2
3.1
'
)
testRuntimeOnly
(
'org.junit.jupiter:junit-jupiter-engine:5.
9
.0'
)
testImplementation
(
'org.junit.jupiter:junit-jupiter-api:5.
10
.0'
,
'org.assertj:assertj-core:3.2
4.2
'
)
testRuntimeOnly
'org.junit.jupiter:junit-jupiter-engine:5.
10
.0'
}
test
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/mandelbrot/ComplexTest.java
+
17
−
1
View file @
6c238f65
package
mandelbrot
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Disabled
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
...
...
@@ -27,14 +28,15 @@ public class ComplexTest {
}
@Test
@Disabled
void
testEquals
(){
assertThat
(
onePlusI
).
isEqualTo
(
onePlusI
);
assertThat
(
onePlusI
).
isEqualTo
(
new
Complex
(
1
,
1
));
assertThat
(
onePlusI
).
isNotEqualTo
(
oneMinusI
);
assertThat
(
two
).
isNotEqualTo
(
twoI
);
}
@Test
@Disabled
void
testGetReal
(){
assertThat
(
two
.
getReal
()).
isCloseTo
(
2
.,
within
(
Helpers
.
EPSILON
));
assertThat
(
onePlusI
.
getReal
()).
isCloseTo
(
1
.,
within
(
Helpers
.
EPSILON
));
...
...
@@ -43,6 +45,7 @@ public class ComplexTest {
}
@Test
@Disabled
void
testGetImaginary
(){
assertThat
(
two
.
getImaginary
()).
isCloseTo
(
0
.,
within
(
Helpers
.
EPSILON
));
assertThat
(
onePlusI
.
getImaginary
()).
isCloseTo
(
1
.,
within
(
Helpers
.
EPSILON
));
...
...
@@ -50,22 +53,26 @@ public class ComplexTest {
}
@Test
@Disabled
void
testOne
(){
assertThat
(
Complex
.
ONE
.
getReal
()).
isCloseTo
(
1
.,
within
(
Helpers
.
EPSILON
));
assertThat
(
Complex
.
ONE
.
getImaginary
()).
isCloseTo
(
0
.,
within
(
Helpers
.
EPSILON
));
}
@Test
@Disabled
void
testI
(){
assertThat
(
Complex
.
I
.
getReal
()).
isCloseTo
(
0
.,
within
(
Helpers
.
EPSILON
));
assertThat
(
Complex
.
I
.
getImaginary
()).
isCloseTo
(
1
.,
within
(
Helpers
.
EPSILON
));
}
@Test
@Disabled
void
testZero
(){
assertThat
(
Complex
.
ZERO
.
getReal
()).
isCloseTo
(
0
.,
within
(
Helpers
.
EPSILON
));
assertThat
(
Complex
.
ZERO
.
getImaginary
()).
isCloseTo
(
0
.,
within
(
Helpers
.
EPSILON
));
}
@Test
@Disabled
void
testNegate
(){
assertThat
(
two
.
negate
()).
isEqualTo
(
new
Complex
(-
2
,
0
));
assertThat
(
minusI
.
negate
()).
isEqualTo
(
i
);
...
...
@@ -73,6 +80,7 @@ public class ComplexTest {
}
@Test
@Disabled
void
testReciprocal
(){
assertThat
(
one
.
reciprocal
()).
isEqualTo
(
one
);
assertThat
(
minusI
.
reciprocal
()).
isEqualTo
(
i
);
...
...
@@ -81,12 +89,14 @@ public class ComplexTest {
}
@Test
@Disabled
void
testReciprocalOfZero
(){
assertThatExceptionOfType
(
ArithmeticException
.
class
)
.
isThrownBy
(()->
zero
.
reciprocal
());
}
@Test
@Disabled
void
testDivide
(){
assertThat
(
onePlusI
.
divide
(
Complex
.
ONE
)).
isEqualTo
(
onePlusI
);
assertThat
(
Complex
.
ONE
.
divide
(
two
)).
isEqualTo
(
new
Complex
(
0.5
,
0
));
...
...
@@ -94,18 +104,21 @@ public class ComplexTest {
}
@Test
@Disabled
void
testDivideByZero
(){
assertThatExceptionOfType
(
ArithmeticException
.
class
)
.
isThrownBy
(()->
one
.
divide
(
zero
));
}
@Test
@Disabled
void
testConjugate
(){
assertThat
(
two
.
conjugate
()).
isEqualTo
(
two
);
assertThat
(
oneMinusI
.
conjugate
()).
isEqualTo
(
onePlusI
);
}
@Test
@Disabled
void
testRotation
(){
assertThat
(
Complex
.
rotation
(
Math
.
PI
/
2
)).
isEqualTo
(
i
);
assertThat
(
Complex
.
rotation
(-
Math
.
PI
/
2
)).
isEqualTo
(
minusI
);
...
...
@@ -115,12 +128,14 @@ public class ComplexTest {
}
@Test
@Disabled
void
testBasicToString
(){
assertThat
(
two
.
toString
()).
contains
(
"2.0"
);
assertThat
(
i
.
toString
()).
contains
(
"i"
);
}
@Test
@Disabled
void
testToStringFormat
(){
assertThat
(
oneMinusI
.
toString
()).
isEqualTo
(
"1.0 - 1.0i"
);
assertThat
(
onePlusI
.
toString
()).
isEqualTo
(
"1.0 + 1.0i"
);
...
...
@@ -130,6 +145,7 @@ public class ComplexTest {
}
@Test
@Disabled
void
testAdd
(){
assertThat
(
i
.
add
(
i
)).
isEqualTo
(
twoI
);
assertThat
(
one
.
add
(
i
)).
isEqualTo
(
onePlusI
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment