File tree Expand file tree Collapse file tree 7 files changed +15
-13
lines changed Expand file tree Collapse file tree 7 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1
1
project (MaterialX)
2
2
set (MATERIALX_MAJOR_VERSION 1)
3
- set (MATERIALX_MINOR_VERSION 35 )
4
- set (MATERIALX_BUILD_VERSION 5 )
3
+ set (MATERIALX_MINOR_VERSION 36 )
4
+ set (MATERIALX_BUILD_VERSION 0 )
5
5
set (MATERIALX_LIBRARY_VERSION ${MATERIALX_MAJOR_VERSION} .${MATERIALX_MINOR_VERSION} .${MATERIALX_BUILD_VERSION} )
6
6
7
7
cmake_minimum_required (VERSION 3.1)
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ TEST_CASE("Element", "[element]")
45
45
elem2->setName (" elem2" );
46
46
REQUIRE (elem1->getName () == " elem1" );
47
47
REQUIRE (elem2->getName () == " elem2" );
48
- REQUIRE_THROWS_AS (elem2->setName (" elem1" ), mx::Exception);
48
+ REQUIRE_THROWS_AS (elem2->setName (" elem1" ), mx::Exception& );
49
49
50
50
// Modify element order.
51
51
mx::DocumentPtr doc2 = doc->copy ();
@@ -54,7 +54,7 @@ TEST_CASE("Element", "[element]")
54
54
REQUIRE (*doc2 != *doc);
55
55
doc2->setChildIndex (" elem1" , doc2->getChildIndex (" elem2" ));
56
56
REQUIRE (*doc2 == *doc);
57
- REQUIRE_THROWS_AS (doc2->setChildIndex (" elem1" , 100 ), mx::Exception);
57
+ REQUIRE_THROWS_AS (doc2->setChildIndex (" elem1" , 100 ), mx::Exception& );
58
58
REQUIRE (*doc2 == *doc);
59
59
60
60
// Create and test an orphaned element.
@@ -64,5 +64,5 @@ TEST_CASE("Element", "[element]")
64
64
orphan = doc3->getChild (" elem1" );
65
65
REQUIRE (orphan);
66
66
}
67
- REQUIRE_THROWS_AS (orphan->getDocument (), mx::ExceptionOrphanedElement);
67
+ REQUIRE_THROWS_AS (orphan->getDocument (), mx::ExceptionOrphanedElement& );
68
68
}
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ TEST_CASE("Geom", "[geom]")
20
20
geominfo2->setGeomAttrValue (" id" , std::string (" 01" ));
21
21
mx::GeomInfoPtr geominfo3 = doc->addGeomInfo (" geominfo3" , " /robot2" );
22
22
geominfo3->setGeomAttrValue (" id" , std::string (" 02" ));
23
- REQUIRE_THROWS_AS (doc->addGeomInfo (" geominfo1" ), mx::Exception);
23
+ REQUIRE_THROWS_AS (doc->addGeomInfo (" geominfo1" ), mx::Exception& );
24
24
25
25
// Create a node graph with a single image node.
26
26
mx::NodeGraphPtr nodeGraph = doc->addNodeGraph ();
27
27
nodeGraph->setFilePrefix (" folder/" );
28
- REQUIRE_THROWS_AS (doc->addNodeGraph (nodeGraph->getName ()), mx::Exception);
28
+ REQUIRE_THROWS_AS (doc->addNodeGraph (nodeGraph->getName ()), mx::Exception& );
29
29
mx::NodePtr image = nodeGraph->addNode (" image" );
30
30
image->setParameterValue (" file" , std::string (" %asset%id_diffuse_%UDIM.tif" ), mx::FILENAME_TYPE_STRING);
31
31
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ TEST_CASE("Node", "[node]")
37
37
38
38
// Create a node graph with two source nodes.
39
39
mx::NodeGraphPtr nodeGraph = doc->addNodeGraph ();
40
- REQUIRE_THROWS_AS (doc->addNodeGraph (nodeGraph->getName ()), mx::Exception);
40
+ REQUIRE_THROWS_AS (doc->addNodeGraph (nodeGraph->getName ()), mx::Exception& );
41
41
mx::NodePtr constant = nodeGraph->addNode (" constant" );
42
42
mx::NodePtr image = nodeGraph->addNode (" image" );
43
43
REQUIRE (nodeGraph->getNodes ().size () == 2 );
Original file line number Diff line number Diff line change 8
8
#include < MaterialXCore/Types.h>
9
9
#include < MaterialXCore/Value.h>
10
10
11
+ #include < cmath>
12
+
11
13
namespace mx = MaterialX;
12
14
13
15
const float EPSILON = 1e-4f ;
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ TEST_CASE("Value strings", "[value]")
59
59
REQUIRE (mx::fromValueString<std::string>(" text" ) == " text" );
60
60
61
61
// Verify that invalid conversions throw exceptions.
62
- REQUIRE_THROWS_AS (mx::fromValueString<int >(" text" ), mx::ExceptionTypeError);
63
- REQUIRE_THROWS_AS (mx::fromValueString<float >(" text" ), mx::ExceptionTypeError);
64
- REQUIRE_THROWS_AS (mx::fromValueString<bool >(" 1" ), mx::ExceptionTypeError);
65
- REQUIRE_THROWS_AS (mx::fromValueString<mx::Color3>(" 1" ), mx::ExceptionTypeError);
62
+ REQUIRE_THROWS_AS (mx::fromValueString<int >(" text" ), mx::ExceptionTypeError& );
63
+ REQUIRE_THROWS_AS (mx::fromValueString<float >(" text" ), mx::ExceptionTypeError& );
64
+ REQUIRE_THROWS_AS (mx::fromValueString<bool >(" 1" ), mx::ExceptionTypeError& );
65
+ REQUIRE_THROWS_AS (mx::fromValueString<mx::Color3>(" 1" ), mx::ExceptionTypeError& );
66
66
}
67
67
68
68
TEST_CASE (" Typed values" , " [value]" )
Original file line number Diff line number Diff line change @@ -203,5 +203,5 @@ TEST_CASE("Load content", "[xmlio]")
203
203
204
204
// Read a non-existent document.
205
205
mx::DocumentPtr doc2 = mx::createDocument ();
206
- REQUIRE_THROWS_AS (mx::readFromXmlFile (doc2, " NonExistent.mtlx" ), mx::ExceptionFileMissing);
206
+ REQUIRE_THROWS_AS (mx::readFromXmlFile (doc2, " NonExistent.mtlx" ), mx::ExceptionFileMissing& );
207
207
}
You can’t perform that action at this time.
0 commit comments