#include <opennurbs_extensions.h>
Public Types | |
enum | Result : unsigned char { Result::Unset = 0, Result::Fail = 1, Result::Errors = 2, Result::Warnings = 3, Result::Pass = 4, Result::Skip = 5 } |
ONX_ModelTest::Result reports the result of a test. More... | |
enum | Type : unsigned char { Type::Unset = 0, Type::Read = 1, Type::ReadWrite = 2, Type::ReadWriteRead = 3, Type::ReadWriteReadCompare = 4 } |
ONX_ModelTest::Type identifies the type of file reading test to perform. More... | |
Public Member Functions | |
ONX_ModelTest ()=default | |
ONX_ModelTest (const ONX_ModelTest &)=default | |
~ONX_ModelTest ()=default | |
void | Dump (ON_TextLog &text_log) const |
Prints test results. More... | |
bool | DumpReadWriteReadModel () const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to the original source file name. Remark: Call after test is completed. More... | |
bool | DumpReadWriteReadModel (const wchar_t *text_file_full_path) const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to a text file with the specified name. Remark: Call after test is completed. More... | |
bool | DumpReadWriteReadModel (ON_TextLog &text_log) const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to the text_log. Remark: Call after test is completed. More... | |
bool | DumpSourceModel () const |
Prints the source model context to text file next to the source file with the file ONX_ModelText_original<PLATFORM>.txt appended to the source file name. Remark: Call after test is completed. More... | |
bool | DumpSourceModel (const wchar_t *text_file_full_path) const |
Prints the source model context to text_log. Remark: Call after test is completed. More... | |
bool | DumpSourceModel (ON_TextLog &text_log) const |
Prints the source model context to text_log. Remark: Call after test is completed. More... | |
ONX_ErrorCounter | ErrorCounter () const |
ONX_ErrorCounter | ErrorCounter (ONX_ModelTest::Type test_type) const |
ONX_ModelTest & | operator= (const ONX_ModelTest &)=default |
bool | ReadTest (const char *file_path, ONX_ModelTest::Type test_type, bool bKeepModels, ON_TextLog *text_log) |
Test ONX_Model::Read() and ONX_Model::Write(). More... | |
bool | ReadTest (const wchar_t *file_path, ONX_ModelTest::Type test_type, bool bKeepModels, ON_TextLog *text_log) |
ONX_Model::ReadTest() can be used to test reading a specific file. More... | |
bool | ReadTest (FILE *fp, ONX_ModelTest::Type test_type, bool bKeepModels, ON_TextLog *text_log) |
ONX_Model::ReadTest() can be used to test reading a specific file. More... | |
bool | ReadTest (ON_BinaryArchive &archive, ONX_ModelTest::Type test_type, bool bKeepModels, ON_TextLog *text_log) |
ONX_Model::Test() can be used to test reading a specific file. More... | |
std::shared_ptr< ONX_Model > | ReadWriteReadModel () const |
const ON_SHA1_Hash | ReadWriteReadModelHash () |
const ON_wString | Source3dmFilePath () const |
unsigned int | Source3dmFileVersion () const |
std::shared_ptr< ONX_Model > | SourceModel () const |
const ON_SHA1_Hash | SourceModelHash () |
ONX_ModelTest::Result | TestResult () const |
ONX_ModelTest::Result | TestResult (ONX_ModelTest::Type test_type) |
ONX_ModelTest::Type | TestType () const |
Test that was performed. More... | |
Static Public Member Functions | |
static bool | DumpModel (const ONX_Model *model, ON_TextLog &text_log) |
Prints the model context to text_log. More... | |
static ONX_ModelTest::Result | ResultFromErrorCounter (ONX_ErrorCounter error_count, ONX_ModelTest::Result no_errors_result) |
static const char * | ResultToString (ONX_ModelTest::Result result) |
static const wchar_t * | ResultToWideString (ONX_ModelTest::Result result) |
static bool | SkipCompare (unsigned int source_3dm_file_version) |
static const char * | TestTypeToString (ONX_ModelTest::Type test_type) |
static const wchar_t * | TestTypeToWideString (ONX_ModelTest::Type test_type) |
static ONX_ModelTest::Result | WorstResult (ONX_ModelTest::Result a, ONX_ModelTest::Result b) |
Static Public Attributes | |
static const ONX_ModelTest | Unset |
|
strong |
ONX_ModelTest::Result reports the result of a test.
|
strong |
ONX_ModelTest::Type identifies the type of file reading test to perform.
Enumerator | |
---|---|
Unset | |
Read | Read the source 3dm file. |
ReadWrite | Read the source 3dm file and write one or two temporary 3dm files. The original source file is not modified. If the 3dm version of the source file is < ON_BinaryArchive::CurrentArchiveVersion(), then two temporary 3dm files are written, the first with 3dm version = ON_BinaryArchive::CurrentArchiveVersion()-10 and the second with 3dm version = ON_BinaryArchive::CurrentArchiveVersion(). For example, if Rhino 6 is the current version of Rhino and a file written by Rhino 5 is read, then both a temporary Rhino 5 and a temporary Rhino 6 3dm file are written. |
ReadWriteRead | Perform the ReadWrite test and read the temporary files. |
ReadWriteReadCompare | Perform the ReadWriteRead test. If one of the temporary files has the same 3dm version as the original source file, verify that the ONX_Models created by reading the original 3dm file and the temporary 3dm file with the same version have identical values of ONX_Model::ContentHash(). |
|
default |
|
default |
|
default |
void ONX_ModelTest::Dump | ( | ON_TextLog & | text_log | ) | const |
Prints test results.
|
static |
Prints the model context to text_log.
bool ONX_ModelTest::DumpReadWriteReadModel | ( | ) | const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to the original source file name. Remark: Call after test is completed.
bool ONX_ModelTest::DumpReadWriteReadModel | ( | const wchar_t * | text_file_full_path | ) | const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to a text file with the specified name. Remark: Call after test is completed.
bool ONX_ModelTest::DumpReadWriteReadModel | ( | ON_TextLog & | text_log | ) | const |
Prints the model obtained from the last read in the read-write-read test to with the file ONX_ModelText_copy<PLATFORM>.txt appended to the text_log. Remark: Call after test is completed.
bool ONX_ModelTest::DumpSourceModel | ( | ) | const |
Prints the source model context to text file next to the source file with the file ONX_ModelText_original<PLATFORM>.txt appended to the source file name. Remark: Call after test is completed.
bool ONX_ModelTest::DumpSourceModel | ( | const wchar_t * | text_file_full_path | ) | const |
Prints the source model context to text_log. Remark: Call after test is completed.
bool ONX_ModelTest::DumpSourceModel | ( | ON_TextLog & | text_log | ) | const |
Prints the source model context to text_log. Remark: Call after test is completed.
ONX_ErrorCounter ONX_ModelTest::ErrorCounter | ( | ) | const |
ONX_ErrorCounter ONX_ModelTest::ErrorCounter | ( | ONX_ModelTest::Type | test_type | ) | const |
|
default |
bool ONX_ModelTest::ReadTest | ( | const char * | file_path, |
ONX_ModelTest::Type | test_type, | ||
bool | bKeepModels, | ||
ON_TextLog * | text_log | ||
) |
Test ONX_Model::Read() and ONX_Model::Write().
file_path | [in] file path |
test_type | [in] test to perform. |
bKeepModels | [in] If true, then the ONX_Models created by reading 3dm archives are saved so the can be examined after the tests complete. |
text_log | [in] If text_log is not nullptr, then a summary of the test is sent to text_log. |
bool ONX_ModelTest::ReadTest | ( | const wchar_t * | file_path, |
ONX_ModelTest::Type | test_type, | ||
bool | bKeepModels, | ||
ON_TextLog * | text_log | ||
) |
ONX_Model::ReadTest() can be used to test reading a specific file.
file_path | [in] file path |
test_type | [in] test to perform. |
bKeepModels | [in] If true, then the ONX_Models created by reading 3dm archives are saved so the can be examined after the tests complete. |
text_log | [in] If text_log is not nullptr, then a summary of the test is sent to text_log. |
bool ONX_ModelTest::ReadTest | ( | FILE * | fp, |
ONX_ModelTest::Type | test_type, | ||
bool | bKeepModels, | ||
ON_TextLog * | text_log | ||
) |
ONX_Model::ReadTest() can be used to test reading a specific file.
fp | [in] fp pointer to a file opened with ON_FileStream::Opent(...,"rb"); |
test_type | [in] test to perform. |
bKeepModels | [in] If true, then the ONX_Models created by reading 3dm archives are saved so the can be examined after the tests complete. |
text_log | [in] If text_log is not nullptr, then a summary of the test is sent to text_log. |
bool ONX_ModelTest::ReadTest | ( | ON_BinaryArchive & | archive, |
ONX_ModelTest::Type | test_type, | ||
bool | bKeepModels, | ||
ON_TextLog * | text_log | ||
) |
ONX_Model::Test() can be used to test reading a specific file.
file_path | [in] file path |
test_type | [in] test to perform. |
bKeepModels | [in] If true, then the ONX_Models created by reading 3dm archives are saved so the can be examined after the tests complete. |
text_log | [in] If text_log is not nullptr, then a summary of the test is sent to text_log. |
std::shared_ptr<ONX_Model> ONX_ModelTest::ReadWriteReadModel | ( | ) | const |
const ON_SHA1_Hash ONX_ModelTest::ReadWriteReadModelHash | ( | ) |
|
static |
error_count | [in] |
no_errors_result | [in] result to return when 0 = error_count.TotalCount(). |
|
static |
|
static |
|
static |
const ON_wString ONX_ModelTest::Source3dmFilePath | ( | ) | const |
unsigned int ONX_ModelTest::Source3dmFileVersion | ( | ) | const |
std::shared_ptr<ONX_Model> ONX_ModelTest::SourceModel | ( | ) | const |
const ON_SHA1_Hash ONX_ModelTest::SourceModelHash | ( | ) |
ONX_ModelTest::Result ONX_ModelTest::TestResult | ( | ) | const |
ONX_ModelTest::Result ONX_ModelTest::TestResult | ( | ONX_ModelTest::Type | test_type | ) |
test_type | [in] |
ONX_ModelTest::Type ONX_ModelTest::TestType | ( | ) | const |
Test that was performed.
|
static |
|
static |
|
static |
|
static |