Files
MeBox/internal/service/runtime_settings_test.go
T
truewhile b0fe40142a Rebrand MMTL to MeBox (name, logo, Docker image) (#17)
* Rebrand MMTL to MeBox across codebase and assets

Rename the project display name, Go module path, environment variable
prefix (MEBOX_*), Docker image references, and UI branding from MMTL/mmtl
to MeBox/mebox. Replace logo assets with the new MeBox icon and keep
legacy SQLite migration support for existing mmtl.db deployments.

Co-authored-by: truewhile <truewhile@users.noreply.github.com>

* Fix logo icons: use cube-only crop without truncated text

Previous icon generation cropped too much of the source image, including
partial MeBox wordmark text that was cut off in square icon containers.
Regenerate logo-64/192/512, favicon, and SVG from cube-only region.

Co-authored-by: truewhile <truewhile@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: truewhile <truewhile@users.noreply.github.com>
2026-09-02 16:26:28 +08:00

44 lines
1.2 KiB
Go

package service
import (
"testing"
"github.com/truewhile/MeBox/internal/config"
)
func TestApplyRuntimeSettingTranscodeSwitches(t *testing.T) {
cfg := &config.Config{}
cfg.Transcoder.Enabled = true
cfg.Transcoder.HardwareAccel = false
ApplyRuntimeSetting(cfg, "transcode.enabled", "false")
if cfg.Transcoder.Enabled {
t.Fatal("transcode.enabled=false should disable transcoding")
}
ApplyRuntimeSetting(cfg, "transcode.hw_enabled", "true")
if !cfg.Transcoder.HardwareAccel {
t.Fatal("transcode.hw_enabled=true should enable hardware accel")
}
ApplyRuntimeSetting(cfg, "transcode.hw_accel", "nvenc")
if cfg.Transcoder.Encoder != "nvenc" {
t.Fatalf("encoder = %q, want nvenc", cfg.Transcoder.Encoder)
}
ApplyRuntimeSetting(cfg, "transcode.max_jobs", "1")
if cfg.Transcoder.MaxConcurrent != 1 {
t.Fatalf("max concurrent = %d, want 1", cfg.Transcoder.MaxConcurrent)
}
ApplyRuntimeSetting(cfg, "app.max_cpu_threads", "99")
if cfg.App.MaxCPUThreads != 8 {
t.Fatalf("max cpu threads = %d, want clamp 8", cfg.App.MaxCPUThreads)
}
ApplyRuntimeSetting(cfg, "app.max_cpu_threads", "0")
if cfg.App.MaxCPUThreads != 1 {
t.Fatalf("max cpu threads = %d, want clamp 1", cfg.App.MaxCPUThreads)
}
}