Schema_Test
class Schema_Test : public CPPUNIT_NS::TestFixture
Functions
| Name | Description |
|---|---|
| testInvalidReadOnlyThrows | @brief Checks that a schema element that uses the definition sequence "...assignmentOptional().defaultValue(value).readOnly()" throws an exception. Conceptually, defaultValue and readOnly are incompatible and readOnly elements should use initialValue() instead of defaultValue(). As the invalid usage does not trigger compilation errors, a throw-at-runtime approach has been used. |
| testTableColNoDefaultValue | @brief Checks that reconfigurable table columns of supported types for which no default value has been specified are fixed. |
| testTableColInitOnly | @brief Checks that init only table columns (unsupported) are fixed, being converted to read-only columns when the table is read-only and to reconfigurable columns when the table is not read-only. |
| testTableColUnsupportedType | @brief Checks that the presence of unsupported table column types throws an exception. |
| testTableColWrongAccessMode | @brief Checks that table columns with access mode incompatible with the table's access mode are fixed (reconfigurable columns on read-only tables become read-only with their initial value set to the default value of the previously reconfigurable column). |
Function Details
testInvalidReadOnlyThrows
void testInvalidReadOnlyThrows()
@brief Checks that a schema element that uses the definition sequence "...assignmentOptional().defaultValue(value).readOnly()" throws an exception.
Conceptually, defaultValue and readOnly are incompatible and readOnly elements should use initialValue() instead of defaultValue(). As the invalid usage does not trigger compilation errors, a throw-at-runtime approach has been used.
testTableColInitOnly
void testTableColInitOnly()
@brief Checks that init only table columns (unsupported) are fixed, being converted to read-only columns when the table is read-only and to reconfigurable columns when the table is not read-only.
testTableColNoDefaultValue
void testTableColNoDefaultValue()
@brief Checks that reconfigurable table columns of supported types for which no default value has been specified are fixed.
The fix consists of adding the missing default value attribute to the row schema with the default initialization value for the column type. If it is not possible to synthesize a default value - e.g. the default initialization value for the column type is outside the allowed range of values - an exception is thrown.
testTableColUnsupportedType
void testTableColUnsupportedType()
@brief Checks that the presence of unsupported table column types throws an exception.
testTableColWrongAccessMode
void testTableColWrongAccessMode()
@brief Checks that table columns with access mode incompatible with the table's access mode are fixed (reconfigurable columns on read-only tables become read-only with their initial value set to the default value of the previously reconfigurable column).