Skip to content

Commit

Permalink
Fixed failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HexagonNico committed Apr 18, 2024
1 parent ebadff1 commit 5f84d84
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
6 changes: 1 addition & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ description := "A Scala library for vectors and matrix math"
scalaVersion := "2.13.12"

// Scala test dependency
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.17" % Test
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" % Test
// Junit test dependency
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test

// Opt out of Scala-version source directory convention
// Needed to run Java Junit tests
crossPaths := false

// Show deprecation warnings
scalacOptions ++= Seq("-unchecked", "-deprecation")
11 changes: 8 additions & 3 deletions src/test/scala/io/github/scalamath/vecmatlib/Vec2dSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class Vec2dSuite extends AnyFunSuite {
val p0 = Vec2d(0.0, 0.0)
val p1 = Vec2d(2.0, 0.0)
val control = Vec2d(1.0, 1.0)
val res = Vec2d(0.0, 2.0)
val res = Vec2d(2.0, 0.0)
assert(p0.bezierDerivative(p1, control, 0.5) === res)
}

Expand All @@ -457,8 +457,13 @@ class Vec2dSuite extends AnyFunSuite {
assert(p0.bezierInterpolate(p3, p1, p2, t) === res)
}

ignore("Cubic Bézier derivative") {
// TODO
test("Cubic Bézier derivative") {
val p0 = Vec2d(0.0, 0.0)
val p1 = Vec2d(2.0, 0.0)
val control1 = Vec2d(0.0, 1.0)
val control2 = Vec2d(2.0, 1.0)
val res = Vec2d(3.0, 0.0)
assert(p0.bezierDerivative(p1, control1, control2, 0.5f) === res)
}

test("Vector equals two values") {
Expand Down
11 changes: 8 additions & 3 deletions src/test/scala/io/github/scalamath/vecmatlib/Vec2fSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class Vec2fSuite extends AnyFunSuite {
val p0 = Vec2f(0.0f, 0.0f)
val p1 = Vec2f(2.0f, 0.0f)
val control = Vec2f(1.0f, 1.0f)
val res = Vec2f(0.0f, 2.0f)
val res = Vec2f(2.0f, 0.0f)
assert(p0.bezierDerivative(p1, control, 0.5f) === res)
}

Expand All @@ -457,8 +457,13 @@ class Vec2fSuite extends AnyFunSuite {
assert(p0.bezierInterpolate(p3, p1, p2, t) === res)
}

ignore("Cubic Bézier derivative") {
// TODO
test("Cubic Bézier derivative") {
val p0 = Vec2f(0.0f, 0.0f)
val p1 = Vec2f(2.0f, 0.0f)
val control1 = Vec2f(0.0f, 1.0f)
val control2 = Vec2f(2.0f, 1.0f)
val res = Vec2f(3.0f, 0.0f)
assert(p0.bezierDerivative(p1, control1, control2, 0.5f) === res)
}

test("Vector equals two values") {
Expand Down
11 changes: 8 additions & 3 deletions src/test/scala/io/github/scalamath/vecmatlib/Vec3dSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class Vec3dSuite extends AnyFunSuite {
val p0 = Vec3d(0.0, 0.0, 0.0)
val p1 = Vec3d(2.0, 0.0, 0.0)
val control = Vec3d(1.0, 1.0, 0.0)
val res = Vec3d(0.0, 2.0, 0.0)
val res = Vec3d(2.0, 0.0, 0.0)
assert(p0.bezierDerivative(p1, control, 0.5) === res)
}

Expand All @@ -447,8 +447,13 @@ class Vec3dSuite extends AnyFunSuite {
assert(p0.bezierInterpolate(p3, p1, p2, t) === res)
}

ignore("Cubic Bézier derivative") {
// TODO
test("Cubic Bézier derivative") {
val p0 = Vec3d(0.0, 0.0, 0.0)
val p1 = Vec3d(2.0, 0.0, 0.0)
val control1 = Vec3d(0.0, 1.0, 0.0)
val control2 = Vec3d(2.0, 1.0, 0.0)
val res = Vec3d(3.0, 0.0, 0.0)
assert(p0.bezierDerivative(p1, control1, control2, 0.5f) === res)
}

test("Vector equals three values") {
Expand Down
11 changes: 8 additions & 3 deletions src/test/scala/io/github/scalamath/vecmatlib/Vec3fSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class Vec3fSuite extends AnyFunSuite {
val p0 = Vec3f(0.0f, 0.0f, 0.0f)
val p1 = Vec3f(2.0f, 0.0f, 0.0f)
val control = Vec3f(1.0f, 1.0f, 0.0f)
val res = Vec3f(0.0f, 2.0f, 0.0f)
val res = Vec3f(2.0f, 0.0f, 0.0f)
assert(p0.bezierDerivative(p1, control, 0.5f) === res)
}

Expand All @@ -447,8 +447,13 @@ class Vec3fSuite extends AnyFunSuite {
assert(p0.bezierInterpolate(p3, p1, p2, t) === res)
}

ignore("Cubic Bézier derivative") {
// TODO
test("Cubic Bézier derivative") {
val p0 = Vec3f(0.0f, 0.0f, 0.0f)
val p1 = Vec3f(2.0f, 0.0f, 0.0f)
val control1 = Vec3f(0.0f, 1.0f, 0.0f)
val control2 = Vec3f(2.0f, 1.0f, 0.0f)
val res = Vec3f(3.0f, 0.0f, 0.0f)
assert(p0.bezierDerivative(p1, control1, control2, 0.5f) === res)
}

test("Vector equals three values") {
Expand Down

0 comments on commit 5f84d84

Please sign in to comment.