Skip to content

Conversation

@hodoulp
Copy link
Contributor

@hodoulp hodoulp commented Dec 4, 2025

Description

The pull request refactors a little bit the code to use available helpers.

Tests Performed

  • Existing unit tests pass
  • Tested on multiple platforms
  • Tested with different render delegates

Checklist

  • I have signed the Contributor License Agreement (CLA) (Corporate or Individual)
  • My code follows the project's coding standards
  • My changes generate no new warnings or errors

hodoulp and others added 2 commits December 4, 2025 15:43
{
static const std::filesystem::path filePath = TestHelpers::getOutputDataFolder();

const std::filesystem::path filePath = TestHelpers::getOutputDataFolder();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No static in case there is a need to change it for a specific unit test.

int width() const { return _width; }
int height() const { return _height; }
bool presentationEnabled() const { return _usePresentationTask; }
const std::filesystem::path& dataPath() const { return _backend->dataPath(); }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used.

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Code Coverage

Package Line Rate Health
include.hvt.dataSource 0%
include.hvt.engine 97%
include.hvt.geometry 0%
include.hvt.sceneIndex 100%
include.hvt.tasks 72%
source.dataSource 0%
source.engine 64%
source.geometry 7%
source.sceneIndex 64%
source.shadow 0%
source.tasks 82%
source.utils 0%
Summary 60% (2127 / 3526)

Copy link
Contributor

@erikaharrison-adsk erikaharrison-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments/questions. If it passes all the tests, etc. seems like fine changes, thanks.

glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);

#ifdef GLFW_SCALE_FRAMEBUFFER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New?

Copy link
Contributor Author

@hodoulp hodoulp Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the last commit merged. In another context the code uses an older glfw not having this setting.

throw std::runtime_error("Failed to initialize the unit test backend!");
}

_backend->setDataPath(localAppPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this was a scoping-like action (should've been RAII). If we no longer need it, great, but sanity check that its all good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, validated locally on macOS & Windows.


void AndroidTestContext::init()
{
std::string localAppPath = getenv("HVT_TEST_ASSETS");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously android impl had been using symlinks - not sure if this is what that was. If things work now, great! Thanks for tidying.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestHelpers::getAssetsDataFolder() is doing that.

@hodoulp hodoulp changed the title OGSMOD-7812 - Move back MaterialUtils in Components OGSMOD-7812 - Centralize the asset access for unit tests Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants