Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate out the tests in mp4_test package #414

Open
vtpl1 opened this issue Mar 1, 2025 · 2 comments
Open

Separate out the tests in mp4_test package #414

vtpl1 opened this issue Mar 1, 2025 · 2 comments

Comments

@vtpl1
Copy link

vtpl1 commented Mar 1, 2025

Can we separate out the tests in separate package for test cases?

This will clean up the main package.

@tobbee
Copy link
Collaborator

tobbee commented Mar 2, 2025

Hi @vtpl1, thanks for your interest in mp4ff.

I don't think it is a good idea to move the tests to a separate directory.
Intstead, I prefer to keep the tests for e.g. the StppBox defined in stpp.go in a sibling test file stpp_test.go.
That makes it easy to check what tests are available, how to use the functions and methods of that box etc.
Moving all the tests to another catalogue will make the development a little harder, in my view.
It is also very common setup for Go packages.

Another possibility in Go is to keep the files where they are but use e.g. mp4_package inside the tests in the mp4 directory. This will force the tests to be black-box tests. I'm more positive to that, but every test file will then have an import
with the full GitHub path of the mp4 package which means that everybody who has an own fork will need to patch all files with their fork address. Given that this repo has a lot of forks, I therefore don't think this change is desired either.

I hope you understand my view-point?

@vtpl1 vtpl1 changed the title Seperate out the tests in mp4_test package Separate out the tests in mp4_test package Mar 3, 2025
@vtpl1
Copy link
Author

vtpl1 commented Mar 3, 2025

Dear Torbjörn @tobbee,
Thank you for elaborate explanation.

I am suggesting to have mp4_test package to be used throughout the repository.
We can see it is being used in mp4/initsegment_create_test.go and mp4/ntp64_test.go

Separating the tests in the same folder as separate package can clearly define publicly exposed members of the structures.

I feel that the golang does not clearly provide solution for forked projects. The forked projects need to use full namespace as "github.com/Eyevinn/mp4ff/bits" to use other packages in the same repo.

This is just a suggestion, but I fully respect your viewpoint.

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

No branches or pull requests

2 participants