Commit d390e603 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3d10/tests: Add GetParentConstantBuffer() checks to effect variable type and class test.

parent 51fcacb8
...@@ -1339,7 +1339,7 @@ static void check_as(ID3D10EffectVariable *variable) ...@@ -1339,7 +1339,7 @@ static void check_as(ID3D10EffectVariable *variable)
static void test_effect_variable_type_class(ID3D10Device *device) static void test_effect_variable_type_class(ID3D10Device *device)
{ {
ID3D10Effect *effect; ID3D10Effect *effect;
ID3D10EffectConstantBuffer *constantbuffer; ID3D10EffectConstantBuffer *constantbuffer, *null_buffer, *parent;
ID3D10EffectVariable *variable; ID3D10EffectVariable *variable;
ID3D10EffectType *type; ID3D10EffectType *type;
D3D10_EFFECT_VARIABLE_DESC vd; D3D10_EFFECT_VARIABLE_DESC vd;
...@@ -1350,6 +1350,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1350,6 +1350,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
hr = D3D10CreateEffectFromMemory(fx_test_evtc, fx_test_evtc[6], 0, device, NULL, &effect); hr = D3D10CreateEffectFromMemory(fx_test_evtc, fx_test_evtc[6], 0, device, NULL, &effect);
ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr); ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
/* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
null_buffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 1);
/* check constantbuffer cb */ /* check constantbuffer cb */
constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &vd); hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &vd);
...@@ -1364,6 +1367,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1364,6 +1367,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)constantbuffer); check_as((ID3D10EffectVariable *)constantbuffer);
parent = constantbuffer->lpVtbl->GetParentConstantBuffer(constantbuffer);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = constantbuffer->lpVtbl->GetType(constantbuffer); type = constantbuffer->lpVtbl->GetType(constantbuffer);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1393,6 +1399,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1393,6 +1399,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1422,6 +1431,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1422,6 +1431,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1451,6 +1463,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1451,6 +1463,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1480,6 +1495,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1480,6 +1495,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1509,6 +1527,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1509,6 +1527,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1538,6 +1559,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1538,6 +1559,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1567,6 +1591,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1567,6 +1591,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1596,6 +1623,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1596,6 +1623,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1625,6 +1655,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1625,6 +1655,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1654,6 +1687,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1654,6 +1687,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1683,6 +1719,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1683,6 +1719,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1712,6 +1751,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1712,6 +1751,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1741,6 +1783,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1741,6 +1783,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1770,6 +1815,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1770,6 +1815,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1799,6 +1847,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1799,6 +1847,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1828,6 +1879,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1828,6 +1879,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1857,6 +1911,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1857,6 +1911,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1886,6 +1943,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1886,6 +1943,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1915,6 +1975,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1915,6 +1975,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1944,6 +2007,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1944,6 +2007,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -1973,6 +2039,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -1973,6 +2039,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
...@@ -2002,6 +2071,9 @@ static void test_effect_variable_type_class(ID3D10Device *device) ...@@ -2002,6 +2071,9 @@ static void test_effect_variable_type_class(ID3D10Device *device)
check_as((ID3D10EffectVariable *)variable); check_as((ID3D10EffectVariable *)variable);
parent = variable->lpVtbl->GetParentConstantBuffer(variable);
ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
type = variable->lpVtbl->GetType(variable); type = variable->lpVtbl->GetType(variable);
hr = type->lpVtbl->GetDesc(type, &td); hr = type->lpVtbl->GetDesc(type, &td);
ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr); ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment