tests: major coverage round for node/render/audio/plugin subsystems
Add 12 gtest files (~400 tests) covering previously untested or under-tested areas: - node_math_test: MathNode operations across number/rational/vector/ matrix/color/sample pairings, shader code generation - node_undo_test: all nodeundo command classes redo/undo - track_test: Track block management, lookup, references, Value() - render_diskcache_test: FrameHashCache EXR/JPEG round trips, DiskManager LRU eviction, state persistence - node_group_test: NodeGroup passthrough registration and serialization - plugin_paraminstance_test: OFX param instances and clip image logic - audio_waveform_test: AudioVisualWaveform + AudioProcessor - node_value_extended_test: NodeValue conversions, NodeValueTable ops, NodeKeyframe/bezier behavior - render_projectcopier_test: ProjectCopier sync, PlaybackCache, AudioPlaybackCache PCM segments - node_core_test: Node input arrays, flags, contexts, links, keyframe events, CopyInputs - clip_traverser_test: ClipBlock speed/reverse/loop time mapping, traverser time propagation - audio_manager_viewer_test: AudioManager device API, ViewerOutput params/streams/signals Also fixes two real bugs found by the new tests: - MathNode vec-vec divide crashed (debug) or produced NaN (release) on the zero padding components of vec2/vec3 operands - NodeKeyframe's default constructor left previous_/next_ and the bezier handles uninitialized
This commit is contained in:
@@ -46,8 +46,14 @@ NodeKeyframe::NodeKeyframe(const rational &time, const QVariant &value,
|
||||
}
|
||||
|
||||
NodeKeyframe::NodeKeyframe()
|
||||
: type_(NodeKeyframe::kLinear)
|
||||
, bezier_control_in_(QPointF(0.0, 0.0))
|
||||
, bezier_control_out_(QPointF(0.0, 0.0))
|
||||
, track_(-1)
|
||||
, element_(-1)
|
||||
, previous_(nullptr)
|
||||
, next_(nullptr)
|
||||
{
|
||||
type_ = NodeKeyframe::kLinear;
|
||||
}
|
||||
|
||||
NodeKeyframe::~NodeKeyframe()
|
||||
|
||||
@@ -279,10 +279,29 @@ void MathNodeBase::ValueInternal(
|
||||
case kPairVecVec: {
|
||||
// We convert all vectors to QVector4D just for simplicity and exploit the fact that kVec4 is higher than kVec2 in
|
||||
// the enum to find the largest data type
|
||||
QVector4D vec_a = RetrieveVector(val_a);
|
||||
QVector4D vec_b = RetrieveVector(val_b);
|
||||
|
||||
if (operation == kOpDivide) {
|
||||
// Lower-dimensional vectors are padded with zeros; dividing the
|
||||
// padding components would be 0/0 (assert in Qt debug builds, NaN
|
||||
// otherwise). Force those components to 0/1 so the result is a
|
||||
// well-defined zero, which is discarded by PushVector anyway.
|
||||
const NodeValue::Type max_type = qMax(val_a.type(), val_b.type());
|
||||
if (max_type == NodeValue::kVec2) {
|
||||
vec_a.setZ(0.0f);
|
||||
vec_a.setW(0.0f);
|
||||
vec_b.setZ(1.0f);
|
||||
vec_b.setW(1.0f);
|
||||
} else if (max_type == NodeValue::kVec3) {
|
||||
vec_a.setW(0.0f);
|
||||
vec_b.setW(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
PushVector(output, qMax(val_a.type(), val_b.type()),
|
||||
PerformAddSubMultDiv<QVector4D, QVector4D>(
|
||||
operation, RetrieveVector(val_a),
|
||||
RetrieveVector(val_b)));
|
||||
PerformAddSubMultDiv<QVector4D, QVector4D>(operation, vec_a,
|
||||
vec_b));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user