Commit 5109d2c9 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

check module size

parent 1b0db7f1
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -1633,6 +1633,29 @@ class TTCN3Validator extends AbstractTTCN3Validator {
	/**
* END: Test Suite Modularization ------------------------------------------------------------------------------
*/
	@Check
	def checkModuleSize(TTCN3Module module) {
		if (!activeProfile.checkModuleSize) {
			return
		}

		val INode node = NodeModelUtils.getNode(module)
		val moduleSize = node.getEndOffset() - node.getOffset();
		val referenceSize = activeProfile.getMaximumAllowedModuleSizeInBytes();
		if (moduleSize > referenceSize) {
			val message = "Module \"" + module.name + "\" is greater (" + moduleSize +
				" bytes) than the maximum allowed module size (" + referenceSize + " bytes)!"
			warning(
				message,
				null, //TODO: EStructuralFeature
				MessageClass.MODULARIZATION.toString,
				node.startLine.toString,
				node.endLine.toString,
				"7.21, " + MiscTools.getMethodName()
			);
		}
	}

//TODO: update error parameters
/*