Skip to content

Commit

Permalink
Add Expression constructor test (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Dec 14, 2023
1 parent 25bc6f0 commit 737b730
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/src/autodiff/ExpressionTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Sleipnir contributors

#include <gtest/gtest.h>
#include <sleipnir/autodiff/Expression.hpp>

TEST(ExpressionTest, DefaultConstructor) {
auto expr = sleipnir::detail::MakeExpressionPtr();

EXPECT_EQ(0.0, expr->value);
EXPECT_EQ(sleipnir::ExpressionType::kConstant, expr->type);
}
11 changes: 11 additions & 0 deletions test/src/autodiff/VariableTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) Sleipnir contributors

#include <gtest/gtest.h>
#include <sleipnir/autodiff/Variable.hpp>

TEST(VariableTest, DefaultConstructor) {
sleipnir::Variable a;

EXPECT_EQ(0.0, a.Value());
EXPECT_EQ(sleipnir::ExpressionType::kConstant, a.expr->type);
}

0 comments on commit 737b730

Please sign in to comment.