 
 -- Test18: Tests to insert root logger without parent.
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (4, 'Test18: Tests to insert root logger without parent');
-DELETE FROM LOGDATA.CONF_LOGGERS;
-INSERT INTO LOGDATA.CONF_LOGGERS (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID)
-  VALUES (0, 'ROOT', NULL, NULL);
+SET EXPECTED_LOGGER = 0;
+SET EXPECTED_PARENT = 0;
+SET EXPECTED_LEVEL = NULL;
+SET ACTUAL_LOGGER = EXPECTED_LOGGER;
+SET ACTUAL_PARENT = NULL;
+SET ACTUAL_LEVEL = NULL;
+DELETE FROM LOGDATA.CONF_LOGGERS;
+INSERT INTO LOGDATA.CONF_LOGGERS (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID)
+  VALUES (ACTUAL_LOGGER, 'ROOT', ACTUAL_PARENT, ACTUAL_LEVEL);
+IF (EXPECTED_LOGGER <> ACTUAL_LOGGER) THEN
+ INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different LOGGER_ID ' || EXPECTED_LOGGER || ' - ' || ACTUAL_LOGGER);
+END IF;
+IF (EXPECTED_PARENT <> ACTUAL_PARENT) THEN
+ INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different PARENT_ID ' || EXPECTED_PARENT || ' - ' || ACTUAL_PARENT);
+END IF;
+IF (EXPECTED_LEVEL <> ACTUAL_LEVEL) THEN
+ INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different LEVEL_ID ' || EXPECTED_LEVEL || ' - ' || ACTUAL_LEVEL);
+END IF;
 COMMIT;
 
 -- Test19: Tests logger with id and null parent
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (4, 'Test19: Tests logger with id and null parent');
+DELETE FROM LOGDATA.CONF_LOGGERS;
 INSERT INTO LOGDATA.CONF_LOGGERS (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID)
   VALUES (5, 'test19', NULL, 0);
 IF (RAISED_LG0C1 = FALSE) THEN


-- Test14: Tests almost all null
INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (4, 'Test14: Tests almost all null');
INSERT INTO LOGDATA.CONF_LOGGERS (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID)
  VALUES (NULL, 'test14', 0, NULL);
COMMIT;

-- Test15: Tests that the given parent should exist 


-- Test9: Tests null level
INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (4, 'Test9: Tests null level');
SET EXPECTED_LOGGER = PREVIOUS VALUE FOR LOGDATA.LOGGER_ID_SEQ + 1;
SET EXPECTED_PARENT = 0;
SET EXPECTED_LEVEL = NULL;
SET ACTUAL_PARENT = 0;
SET ACTUAL_LEVEL = NULL;
INSERT INTO LOGDATA.CONF_LOGGERS (NAME, PARENT_ID, LEVEL_ID)
  VALUES ('test9', ACTUAL_PARENT, ACTUAL_LEVEL);
SELECT LOGGER_ID, PARENT_ID, LEVEL_ID INTO ACTUAL_LOGGER, ACTUAL_PARENT, ACTUAL_LEVEL
  FROM LOGDATA.CONF_LOGGERS
  WHERE LOGGER_ID = PREVIOUS VALUE FOR LOGDATA.LOGGER_ID_SEQ;
IF (EXPECTED_LOGGER <> ACTUAL_LOGGER) THEN
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different LOGGER_ID ' || EXPECTED_LOGGER || ' - ' || ACTUAL_LOGGER);
END IF;
IF (EXPECTED_PARENT <> ACTUAL_PARENT) THEN
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different PARENT_ID ' || EXPECTED_PARENT || ' - ' || ACTUAL_PARENT);
END IF;
IF (EXPECTED_LEVEL <> ACTUAL_LEVEL) THEN
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Different LEVEL_ID ' || EXPECTED_LEVEL || ' - ' || ACTUAL_LEVEL);
END IF;
COMMIT;

-- Test10: Tests negative level
