Commit b457fc24 authored by Brian Panneton's avatar Brian Panneton Committed by Kenneth Leiter

FIX: Corrected SWIG overriding equals for Java and Python

Added testing for this for both languages as well. In Java
since you are not allowed to overwrite operators, we just
ignore the warning and overwrite .equals. In Python, we
overwrite the operator.
parent 14252b3f
......@@ -41,11 +41,66 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%import XdmfCore.i
#ifdef SWIGJAVA
%extend XdmfAttributeCenter {
bool equals(boost::shared_ptr<XdmfAttributeCenter> attributeCenter) {
return(self->IsEqual(attributeCenter));
}
};
%extend XdmfAttributeType {
bool equals(boost::shared_ptr<XdmfAttributeType> attributeType) {
return(self->IsEqual(attributeType));
}
};
%extend XdmfGeometryType {
bool equals(boost::shared_ptr<XdmfGeometryType> geometryType) {
return(self->IsEqual(geometryType));
}
};
%extend XdmfGridCollectionType {
bool equals(boost::shared_ptr<XdmfGridCollectionType> collectionType) {
return(self->IsEqual(collectionType));
}
};
%extend XdmfSetType {
bool equals(boost::shared_ptr<XdmfSetType> setType) {
return(self->IsEqual(setType));
}
};
%extend XdmfTopologyType {
bool equals(boost::shared_ptr<XdmfTopologyType> topologyType) {
return(self->IsEqual(topologyType));
}
};
%ignore XdmfTopologyType::operator==(const XdmfTopologyType & topologyType) const;
%ignore XdmfTopologyType::operator!=(const XdmfTopologyType & topologyType) const;
%ignore XdmfSetType::operator==(const XdmfSetType & setType) const;
%ignore XdmfSetType::operator!=(const XdmfSetType & setType) const;
%ignore XdmfGridCollectionType::operator==(const XdmfGridCollectionType & collectionType) const;
%ignore XdmfGridCollectionType::operator!=(const XdmfGridCollectionType & collectionType) const;
%ignore XdmfAttributeCenter::operator==(const XdmfAttributeCenter & attributeCenter) const;
%ignore XdmfAttributeCenter::operator!=(const XdmfAttributeCenter & attributeCenter) const;
%ignore XdmfGeometryType::operator==(const XdmfGeometryType & geometryType) const;
%ignore XdmfGeometryType::operator!=(const XdmfGeometryType & geometryType) const;
%ignore XdmfAttributeType::operator==(const XdmfAttributeType & attributeType) const;
%ignore XdmfAttributeType::operator!=(const XdmfAttributeType & attributeType) const;
#endif
#ifdef SWIGPYTHON
%extend XdmfAttributeCenter {
bool __eq__(boost::shared_ptr<XdmfAttributeCenter> attributeCenter) {
return(self->IsEqual(attributeCenter));
}
};
#endif
#ifdef SWIGPYTHON
%pythoncode {
from XdmfCore import *
}
%typemap(out) boost::shared_ptr<XdmfItem> {
if(boost::shared_ptr<XdmfAttribute> attribute = boost::shared_dynamic_cast<XdmfAttribute>($1))
{
......
......@@ -91,6 +91,16 @@ bool XdmfAttributeCenter::operator!=(const XdmfAttributeCenter & attributeCenter
return !this->operator==(attributeCenter);
}
bool XdmfAttributeCenter::IsEqual(boost::shared_ptr<XdmfAttributeCenter> attributeCenter)
{
if(attributeCenter == NULL) return false;
if(this == attributeCenter.get()
&& mName == attributeCenter->mName
) return true;
return false;
}
void XdmfAttributeCenter::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["Center"] = mName;
......
......@@ -51,6 +51,14 @@ public:
*/
bool operator!=(const XdmfAttributeCenter & attributeCenter) const;
/**
* Compare two XdmfAttributeCenter for equality (for wrapping)
*
* @param attributeCenter a boost shared pointer to an XdmfAttributeCenter to compare equality to.
* @return true if the XdmfAttributeCenter are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfAttributeCenter> attributeCenter);
protected:
/**
......
......@@ -115,6 +115,16 @@ bool XdmfAttributeType::operator!=(const XdmfAttributeType & attributeType) cons
return !this->operator==(attributeType);
}
bool XdmfAttributeType::IsEqual(boost::shared_ptr<XdmfAttributeType> attributeType)
{
if(attributeType == NULL) return false;
if(this == attributeType.get()
&& mName == attributeType->mName
) return true;
return false;
}
void XdmfAttributeType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["Type"] = mName;
......
......@@ -55,6 +55,15 @@ public:
*/
bool operator!=(const XdmfAttributeType & attributeType) const;
/**
* Compare two XdmfAttributeType for equality (for wrapping)
*
* @param attributeType a boost shared pointer to an XdmfAttributeType to compare equality to.
* @return true if the XdmfAttributeType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfAttributeType> attributeType);
protected:
/**
......
......@@ -123,6 +123,17 @@ bool XdmfGeometryType::operator!=(const XdmfGeometryType& geometryType) const
return !this->operator==(geometryType);
}
bool XdmfGeometryType::IsEqual(boost::shared_ptr<XdmfGeometryType> geometryType)
{
if(geometryType == NULL) return false;
if(this == geometryType.get()
&& mDimensions == geometryType->mDimensions
&& mName == geometryType->mName
) return true;
return false;
}
unsigned int XdmfGeometryType::getDimensions() const
{
return mDimensions;
......
......@@ -71,6 +71,14 @@ public:
*/
bool operator!=(const XdmfGeometryType & geometryType) const;
/**
* Compare two XdmfGeometryType for equality (for wrapping)
*
* @param geometryType a boost shared pointer to an XdmfGeometryType to compare equality to.
* @return true if the XdmfGeometryType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfGeometryType> geometryType);
protected:
/**
......
......@@ -71,6 +71,15 @@ bool XdmfGridCollectionType::operator!=(const XdmfGridCollectionType & collectio
return !this->operator==(collectionType);
}
bool XdmfGridCollectionType::IsEqual(boost::shared_ptr<XdmfGridCollectionType> collectionType)
{
if(collectionType == NULL) return false;
if(this == collectionType.get()
&& mName == collectionType->mName
) return true;
return false;
}
void XdmfGridCollectionType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["CollectionType"] = mName;
......
......@@ -47,6 +47,14 @@ public:
*/
bool operator!=(const XdmfGridCollectionType & collectionType) const;
/**
* Compare two XdmfGridCollectionType for equality (for wrapping)
*
* @param collectionType a boost shared pointer to an XdmfGridCollectionType to compare equality to.
* @return true if the XdmfGridCollectionType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfGridCollectionType> collectionType);
protected:
/**
......
......@@ -95,6 +95,16 @@ bool XdmfSetType::operator!=(const XdmfSetType & setType) const
return !this->operator==(setType);
}
bool XdmfSetType::IsEqual(boost::shared_ptr<XdmfSetType> setType)
{
if(setType == NULL) return false;
if(this == setType.get()
&& mName == setType->mName
) return true;
return false;
}
void XdmfSetType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["Type"] = this->mName;
......
......@@ -50,6 +50,14 @@ public:
*/
bool operator!=(const XdmfSetType & setType) const;
/**
* Compare two XdmfSetType for equality (for wrapping)
*
* @param setType a boost shared pointer to an XdmfSetType to compare equality to.
* @return true if the XdmfSetType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfSetType> setType);
protected:
/**
......
......@@ -362,6 +362,18 @@ bool XdmfTopologyType::operator!=(const XdmfTopologyType& topologyType) const
return !this->operator==(topologyType);
}
bool XdmfTopologyType::IsEqual(boost::shared_ptr<XdmfTopologyType> topologyType)
{
if(topologyType == NULL) return false;
if(this == topologyType.get()
&& mNodesPerElement == topologyType->mNodesPerElement
&& mCellType == topologyType->mCellType
&& mName == topologyType->mName
) return true;
return false;
}
XdmfTopologyType::CellType XdmfTopologyType::getCellType() const
{
return mCellType;
......
......@@ -126,6 +126,15 @@ public:
*/
bool operator!=(const XdmfTopologyType & topologyType) const;
/**
* Compare two XdmfTopologyType for equality (for wrapping)
*
* @param topologyType a boost shared pointer to an XdmfTopologyType to compare equality to.
* @return true if the XdmfTopologyType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfTopologyType> topologyType);
protected:
/**
......
......@@ -4,7 +4,7 @@
* Created on: Jan 29, 2010
* Author: kleiter
*/
#include <iostream> //REMOVE
#include <sstream>
#include "XdmfArrayType.hpp"
......@@ -153,6 +153,16 @@ bool XdmfArrayType::operator!=(const XdmfArrayType & arrayType) const
return !this->operator==(arrayType);
}
bool XdmfArrayType::IsEqual(boost::shared_ptr<XdmfArrayType> arrayType)
{
if(arrayType == NULL) return false;
if(this == arrayType.get()
&& mName == arrayType->mName
&& mPrecision == arrayType->mPrecision
) return true;
return false;
}
void XdmfArrayType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["DataType"] = mName;
......
......@@ -60,6 +60,14 @@ public:
* @return true if the XdmfArrayTypes are not equal.
*/
bool operator!=(const XdmfArrayType & arrayType) const;
/**
* Compare two XdmfArrayTypes for equality (for java wrapping)
*
* @param arrayType a boost shared pointer to an XdmfArrayType to compare equality to.
* @return true if the XdmfArrayTypes are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfArrayType> arrayType);
int getElementSize() const;
......
......@@ -24,6 +24,25 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%include std_vector.i
%include loki/Visitor.h
#ifdef SWIGJAVA
%extend XdmfArrayType {
bool equals(boost::shared_ptr<XdmfArrayType> arrayType) {
return(self->IsEqual(arrayType));
}
};
%ignore XdmfArrayType::operator==(const XdmfArrayType & arrayType) const;
%ignore XdmfArrayType::operator!=(const XdmfArrayType & arrayType) const;
#endif
#ifdef SWIGPYTHON
%extend XdmfArrayType {
bool __eq__(boost::shared_ptr<XdmfArrayType> arrayType) {
return(self->IsEqual(arrayType));
}
};
#endif
// Shared Pointer Templates
%shared_ptr(XdmfArray)
%shared_ptr(XdmfArrayType)
......@@ -257,3 +276,4 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
};
};
#endif /* SWIGJAVA */
......@@ -7,13 +7,13 @@ SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_DEPENDENCIES
# Note: JAVA_TEST_CLASSPATH is also set in core
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_CLASSPATH
".:${XDMF_CORE_JAVA_JAR}"
".:${XDMF_CORE_JAVA_JAR}:"
)
# Add any ldpath directories that the java tests may need
# Note: JAVA_TEST_LDPATH is also set in core
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_LDPATH
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}:"
)
# Include our test macros
......@@ -24,14 +24,15 @@ include (UseJavaTest)
# have extra arguments (ie: ADD_JAVA_TEST(testname inputfile))
# Read UseJavaTest.cmake for more information
# ------------------------
# none
ADD_JAVA_TEST(TestXdmfArrayTypeEquals)
# Add any java cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
# have multiple files (ie: CLEAN_JAVA_TEST(testname outputfile1 ...))
# Read UseCxxTest.cmake for more information
# ---------------------------------------
# none
CLEAN_JAVA_TEST(TestXdmfArrayTypeEquals)
# Add a custom target for all java tests
# Note: ${TARGETS} is set in ADD_JAVA_TEST
......
import mil.army.arl.xdmf.*;
public class TestXdmfArrayTypeEquals {
static {
System.loadLibrary("XdmfCoreJava");
}
public static void main (String argv[]) {
System.out.println("Hello World");
XdmfArrayType type1a = XdmfArrayType.Int16();
XdmfArrayType type1b = XdmfArrayType.Int16();
XdmfArrayType type2 = XdmfArrayType.Int32();
// Check IsEquals
if(!(type1a.IsEqual(type1b))) /*True*/ {
throw new SecurityException("Failed True Check");
}
if((type1a.IsEqual(type2))) /*False*/ {
throw new SecurityException("Failed False Check");
}
// Check equals
if(!(type1a.equals(type1b))) /*True*/ {
throw new SecurityException("Failed True Check (equals)");
}
if(type1a.equals(type2)) /*False*/ {
throw new SecurityException("Failed False Check (equals)");
}
// Check ==
if(type1a == type1b) /*False*/ {
throw new SecurityException("Failed True Check (==)");
}
if(type1a == type2) /*False*/ {
throw new SecurityException("Failed False Check (==)");
}
}
}
......@@ -19,6 +19,7 @@ include(UsePythonTest)
# Read UsePythonTest.cmake for more information
# ---------------------
ADD_PYTHON_TEST(TestXdmfArray)
ADD_PYTHON_TEST(TestXdmfArrayTypeEquals)
# Add any python cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
......@@ -26,6 +27,7 @@ ADD_PYTHON_TEST(TestXdmfArray)
# Read UseCxxTest.cmake for more information
# ---------------------------------------
CLEAN_PYTHON_TEST(TestXdmfArray)
CLEAN_PYTHON_TEST(TestXdmfArrayTypeEquals)
# Add a custom target for all python tests
# Note: ${TARGETS} is set in ADD_PYTHON_TEST
......
from XdmfCore import *
if __name__ == "__main__":
type1 = XdmfArrayType.Int16
type2 = XdmfArrayType.Int16
type3 = XdmfArrayType.Int32
print "IsEqual True"
assert type1 == type2
print "IsEqual False"
assert not type1 == type3
......@@ -9,15 +9,16 @@ SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_DEPENDENCIES
# Note: JAVA_TEST_CLASSPATH is also set in core
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_CLASSPATH
"${java_classpath}:${XDMF_JAVA_JAR}"
"${java_classpath}${XDMF_JAVA_JAR}:"
)
# Add any ldpath directories that the java tests may need
# Note: JAVA_TEST_LDPATH is also set in core
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_LDPATH
"${java_ldpath}:"
)
"${java_ldpath}"
)
>>>>>>> FIX: Corrected SWIG overriding equals for Java and Python
# Include our test macros
include (UseJavaTest)
......@@ -28,6 +29,7 @@ include (UseJavaTest)
# Read UseJavaTest.cmake for more information
# ------------------------
ADD_JAVA_TEST(TestXdmfJava)
ADD_JAVA_TEST(TestXdmfEquals)
# Add any java cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
......@@ -37,6 +39,7 @@ ADD_JAVA_TEST(TestXdmfJava)
CLEAN_JAVA_TEST(TestXdmfJava
outputJavaTest.xmf
)
CLEAN_JAVA_TEST(TestXdmfEquals)
# Add a custom target for all java tests
# Note: ${TARGETS} is set in ADD_JAVA_TEST
......
import mil.army.arl.xdmf.*;
public class TestXdmfEquals {
static {
System.loadLibrary("XdmfCoreJava");
System.loadLibrary("XdmfJava");
}
public static void main (String argv[]) {
System.out.println("Hello World");
System.out.println("Checking XdmfAttributeCenter");
XdmfAttributeCenter xac1 = XdmfAttributeCenter.Grid();
XdmfAttributeCenter xac2 = XdmfAttributeCenter.Grid();
XdmfAttributeCenter xac3 = XdmfAttributeCenter.Cell();
// Check IsEquals
if(!(xac1.IsEqual(xac2))) /*True*/
throw new SecurityException("Failed True Check");
if((xac1.IsEqual(xac3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xac1.equals(xac2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xac1.equals(xac3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xac1 == xac2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xac1 == xac3) /*False*/
throw new SecurityException("Failed False Check (==)");
System.out.println("Checking XdmfAttributeType");
XdmfAttributeType xat1 = XdmfAttributeType.Scalar();
XdmfAttributeType xat2 = XdmfAttributeType.Scalar();
XdmfAttributeType xat3 = XdmfAttributeType.Tensor();
// Check IsEquals
if(!(xat1.IsEqual(xat2))) /*True*/
throw new SecurityException("Failed True Check");
if((xat1.IsEqual(xat3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xat1.equals(xat2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xat1.equals(xat3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xat1 == xat2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xat1 == xat3) /*False*/
throw new SecurityException("Failed False Check (==)");
System.out.println("Checking XdmfGeometryType");
XdmfGeometryType xgt1 = XdmfGeometryType.XYZ();
XdmfGeometryType xgt2 = XdmfGeometryType.XYZ();
XdmfGeometryType xgt3 = XdmfGeometryType.XY();
// Check IsEquals
if(!(xgt1.IsEqual(xgt2))) /*True*/
throw new SecurityException("Failed True Check");
if((xgt1.IsEqual(xgt3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xgt1.equals(xgt2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xgt1.equals(xgt3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xgt1 == xgt2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xgt1 == xgt3) /*False*/
throw new SecurityException("Failed False Check (==)");
System.out.print("Checking XdmfGridCollection");
XdmfGridCollectionType xgct1 = XdmfGridCollectionType.Spatial();
XdmfGridCollectionType xgct2 = XdmfGridCollectionType.Spatial();
XdmfGridCollectionType xgct3 = XdmfGridCollectionType.Temporal();
// Check IsEquals
if(!(xgct1.IsEqual(xgct2))) /*True*/
throw new SecurityException("Failed True Check");
if((xgct1.IsEqual(xgct3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xgct1.equals(xgct2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xgct1.equals(xgct3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xgct1 == xgct2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xgct1 == xgct3) /*False*/
throw new SecurityException("Failed False Check (==)");
System.out.println("Checking XdmfSetType");
XdmfSetType xst1 = XdmfSetType.Node();
XdmfSetType xst2 = XdmfSetType.Node();
XdmfSetType xst3 = XdmfSetType.Face();
// Check IsEquals
if(!(xst1.IsEqual(xst2))) /*True*/
throw new SecurityException("Failed True Check");
if((xst1.IsEqual(xst3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xst1.equals(xst2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xst1.equals(xst3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xst1 == xst2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xst1 == xst3) /*False*/
throw new SecurityException("Failed False Check (==)");
System.out.println("Checking XdmfTopologyType");
XdmfTopologyType xtt1 = XdmfTopologyType.Polyvertex();
XdmfTopologyType xtt2 = XdmfTopologyType.Polyvertex();
XdmfTopologyType xtt3 = XdmfTopologyType.Polyline();
// Check IsEquals
if(!(xtt1.IsEqual(xtt2))) /*True*/
throw new SecurityException("Failed True Check");
if((xtt1.IsEqual(xtt3))) /*False*/
throw new SecurityException("Failed False Check");
// Check equals
if(!(xtt1.equals(xtt2))) /*True*/
throw new SecurityException("Failed True Check (equals)");
if(xtt1.equals(xtt3)) /*False*/
throw new SecurityException("Failed False Check (equals)");
// Check ==
if(xtt1 == xtt2) /*False*/
throw new SecurityException("Failed True Check (==)");
if(xtt1 == xtt3) /*False*/
throw new SecurityException("Failed False Check (==)");
}
}
......@@ -22,6 +22,7 @@ include(UsePythonTest)
# -----------------------
ADD_PYTHON_TEST(TestXdmfHDF5Writer)
ADD_PYTHON_TEST(TestXdmfWriter)
ADD_PYTHON_TEST(TestXdmfEquals)
# Add any python cleanup here:
# Note: We don't want to use a foreach loop to test the files incase we
......@@ -35,6 +36,7 @@ CLEAN_PYTHON_TEST(TestXdmfWriter
output.h5
output.xmf
)
CLEAN_PYTHON_TEST(TestXdmfEquals)
# Add a custom target for all python tests
# Note: ${TARGETS} is set in ADD_PYTHON_TEST
......
from XdmfCore import *
from Xdmf import *
if __name__ == "__main__":
xac1 = XdmfAttributeCenter.Grid
xac2 = XdmfAttributeCenter.Grid
xac3 = XdmfAttributeCenter.Cell
print "XdmfAttributeCenter True Check"
assert xac1 == xac2
print "XdmfAttributeCenter False Check"
assert not xac1 == xac3
xat1 = XdmfAttributeType.Scalar
xat2 = XdmfAttributeType.Scalar
xat3 = XdmfAttributeType.Tensor
print "XdmfAttributeType True Check"
assert xat1 == xat2
print "XdmfAttributeType False Check"
assert not xat1 == xat3
xgt1 = XdmfGeometryType.XYZ
xgt2 = XdmfGeometryType.XYZ
xgt3 = XdmfGeometryType.XY
print "XdmfGeometryType True Check"
assert xgt1 == xgt2
print "XdmfGeometryType False Check"
assert not xgt1 == xgt3
xgct1 = XdmfGridCollectionType.Spatial
xgct2 = XdmfGridCollectionType.Spatial
xgct3 = XdmfGridCollectionType.Temporal
print "XdmfGridCollectionType True Check"
assert xgct1 == xgct2
print "XdmfGridCollectionType False Check"
assert not xgct1 == xgct3
xst1 = XdmfSetType.Node
xst2 = XdmfSetType.Node
xst3 = XdmfSetType.Face
print "XdmfSetType True Check"
assert xst1 == xst2
print "XdmfSetType False Check"
assert not xst1 == xst3
xtt1 = XdmfTopologyType.Polyvertex
xtt2 = XdmfTopologyType.Polyvertex
xtt3 = XdmfTopologyType.Polyline
print "XdmfTopologyType True Check"
assert xtt1 == xtt2
print "XdmfTopologyType False Check"
assert not xtt1 == xtt3
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