#include <opennurbs_extensions.h>
|
| ONX_ModelTest ()=default |
|
| ONX_ModelTest (const ONX_ModelTest &)=default |
|
| ~ONX_ModelTest ()=default |
|
void | Dump (ON_TextLog &text_log) const |
|
bool | DumpReadWriteReadModel () const |
|
bool | DumpReadWriteReadModel (const wchar_t *text_file_full_path) const |
|
bool | DumpReadWriteReadModel (ON_TextLog &text_log) const |
|
bool | DumpSourceModel () const |
|
bool | DumpSourceModel (const wchar_t *text_file_full_path) const |
|
bool | DumpSourceModel (ON_TextLog &text_log) const |
|
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, const char *text_log_file_path, ON_TextLog *text_log) |
|
bool | ReadTest (const wchar_t *file_path, ONX_ModelTest::Type test_type, bool bKeepModels, const wchar_t *text_log_file_path, ON_TextLog *text_log) |
|
bool | ReadTest (FILE *fp, ONX_ModelTest::Type test_type, bool bKeepModels, const wchar_t *text_log_file_path, ON_TextLog *text_log) |
|
bool | ReadTest (ON_BinaryArchive &archive, ONX_ModelTest::Type test_type, bool bKeepModels, const wchar_t *text_log_file_path, ON_TextLog *text_log) |
|
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...
|
|
const ON_wString | TextLogSource3dmFilePath () const |
|
◆ Result
ONX_ModelTest::Result reports the result of a test.
Enumerator |
---|
Unset | summary> Test result is not set. /summary> summary> Test failed to complete. /summary>
|
Fail | summary> Test was performed and completed, but at least one ON_ERROR occurred. /summary>
|
Errors | summary> Test was performed and completed, but at least one ON_WARNING occurred. /summary>
|
Warnings | summary> Test was performed and passed. /summary>
|
Pass | summary> Test was not performed because the input did not satisfy prerequisites or an earlier test failed. For example, if a ONX_ModelReadTest::TestType::ReadWriteReadCompare test is requested and the source file is a Rhino 1 file, the compare test is skipped. For example, if a ONX_ModelReadTest::TestType::ReadWriteRead test is requested and the Write test fails, the second Read test is skipped. /summary>
|
Skip | |
◆ Type
ONX_ModelTest::Type identifies the type of file reading test to perform.
< XXRH_C_SHARED_ENUM ///< [ONX_ModelTest::Type] [Rhino.Geometry.Something.Type] [nested:byte]
Enumerator |
---|
Unset | summary> Read the source 3dm file. /summary>
|
Read | summary> 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. /summary>
|
ReadWrite | summary> Perform the ReadWrite test and read the temporary files. /summary>
|
ReadWriteRead | summary> 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(). /summary>
|
ReadWriteReadCompare | |
◆ ONX_ModelTest() [1/2]
ONX_ModelTest::ONX_ModelTest |
( |
| ) |
|
|
default |
◆ ~ONX_ModelTest()
ONX_ModelTest::~ONX_ModelTest |
( |
| ) |
|
|
default |
◆ ONX_ModelTest() [2/2]
◆ Dump()
void ONX_ModelTest::Dump |
( |
ON_TextLog & |
text_log | ) |
const |
Description: Prints test results.
◆ DumpModel()
Description: Prints the model context to text_log.
◆ DumpReadWriteReadModel() [1/3]
bool ONX_ModelTest::DumpReadWriteReadModel |
( |
| ) |
const |
Description: 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.
◆ DumpReadWriteReadModel() [2/3]
bool ONX_ModelTest::DumpReadWriteReadModel |
( |
const wchar_t * |
text_file_full_path | ) |
const |
Description: 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.
◆ DumpReadWriteReadModel() [3/3]
bool ONX_ModelTest::DumpReadWriteReadModel |
( |
ON_TextLog & |
text_log | ) |
const |
Description: 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.
◆ DumpSourceModel() [1/3]
bool ONX_ModelTest::DumpSourceModel |
( |
| ) |
const |
Description: 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.
◆ DumpSourceModel() [2/3]
bool ONX_ModelTest::DumpSourceModel |
( |
const wchar_t * |
text_file_full_path | ) |
const |
Description: Prints the source model context to text_log. Remark: Call after test is completed.
◆ DumpSourceModel() [3/3]
bool ONX_ModelTest::DumpSourceModel |
( |
ON_TextLog & |
text_log | ) |
const |
Description: Prints the source model context to text_log. Remark: Call after test is completed.
◆ ErrorCounter() [1/2]
Returns: Total number of failures, errors, and warnings for all tests that were performed.
◆ ErrorCounter() [2/2]
Returns: Total number of failures, errors, and warnings for all tests that were performed.
◆ operator=()
◆ ReadTest() [1/4]
bool ONX_ModelTest::ReadTest |
( |
const char * |
file_path, |
|
|
ONX_ModelTest::Type |
test_type, |
|
|
bool |
bKeepModels, |
|
|
const char * |
text_log_file_path, |
|
|
ON_TextLog * |
text_log |
|
) |
| |
Description: Test ONX_Model::Read() and ONX_Model::Write(). Parameters: 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_file_path - [in] If not empty, the string to use for file_path in the output text_log. This is used to create logs on different computers that can be compared. text_log - [in] If text_log is not nullptr, then a summary of the test is sent to text_log. Returns: True if every test passed with no warnings or errors. False if a test failed or warnings or errors occurred.
◆ ReadTest() [2/4]
bool ONX_ModelTest::ReadTest |
( |
const wchar_t * |
file_path, |
|
|
ONX_ModelTest::Type |
test_type, |
|
|
bool |
bKeepModels, |
|
|
const wchar_t * |
text_log_file_path, |
|
|
ON_TextLog * |
text_log |
|
) |
| |
Description: ONX_Model::ReadTest() can be used to test reading a specific file. Parameters: 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_file_path - [in] If not empty, the string to use for file_path in the output text_log. This is used to create logs on different computers that can be compared. text_log - [in] If text_log is not nullptr, then a summary of the test is sent to text_log. Returns: True if every test passed with no warnings or errors. False if a test failed or warnings or errors occurred.
◆ ReadTest() [3/4]
bool ONX_ModelTest::ReadTest |
( |
FILE * |
fp, |
|
|
ONX_ModelTest::Type |
test_type, |
|
|
bool |
bKeepModels, |
|
|
const wchar_t * |
text_log_file_path, |
|
|
ON_TextLog * |
text_log |
|
) |
| |
Description: ONX_Model::ReadTest() can be used to test reading a specific file. Parameters: 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_file_path - [in] If not empty, the string to use for file_path in the output text_log. This is used to create logs on different computers that can be compared. text_log - [in] If text_log is not nullptr, then a summary of the test is sent to text_log. Returns: True if every test passed with no warnings or errors. False if a test failed or warnings or errors occurred.
◆ ReadTest() [4/4]
Description: ONX_Model::Test() can be used to test reading a specific file. Parameters: archive - [in]
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_file_path - [in] If not empty, the string to use for file_path in the output text_log. This is used to create logs on different computers that can be compared. text_log - [in] If text_log is not nullptr, then a summary of the test is sent to text_log. Returns: True if every test passed with no warnings or errors. False if a test failed or warnings or errors occurred.
◆ ReadWriteReadModel()
std::shared_ptr<ONX_Model> ONX_ModelTest::ReadWriteReadModel |
( |
| ) |
const |
Returns: nullptr if the read write read test was not performed or was run with bKeepModels=false. Otherwise, a pointer to the result of the read write read test.
◆ ReadWriteReadModelHash()
const ON_SHA1_Hash ONX_ModelTest::ReadWriteReadModelHash |
( |
| ) |
|
◆ ResultFromErrorCounter()
Parameters: error_count - [in] no_errors_result - [in] result to return when 0 = error_count.TotalCount().
◆ ResultToString()
◆ ResultToWideString()
◆ SkipCompare()
static bool ONX_ModelTest::SkipCompare |
( |
unsigned int |
source_3dm_file_version | ) |
|
|
static |
◆ Source3dmFilePath()
const ON_wString ONX_ModelTest::Source3dmFilePath |
( |
| ) |
const |
Returns: The name of the source 3dm file.
◆ Source3dmFileVersion()
unsigned int ONX_ModelTest::Source3dmFileVersion |
( |
| ) |
const |
Returns: Version of the 3dm fie, 1,2,3,4,5,50,60,...
◆ SourceModel()
std::shared_ptr<ONX_Model> ONX_ModelTest::SourceModel |
( |
| ) |
const |
Returns: nullptr if the test was run with bKeepModels=false or the source archive could not be read. Otherwise, a pointer to the source model.
◆ SourceModelHash()
◆ TestResult() [1/2]
Returns: Worst result for any test that was attempted.
◆ TestResult() [2/2]
Parameters: test_type - [in] Returns: Result of the test identified by the test_type parameter.
◆ TestType()
◆ TestTypeToString()
◆ TestTypeToWideString()
◆ TextLogSource3dmFilePath()
const ON_wString ONX_ModelTest::TextLogSource3dmFilePath |
( |
| ) |
const |
Returns: The string used in the output log to identify the source 3dm file.
◆ WorstResult()
◆ Unset