]> Devoid-pointer.net GitWeb - Nine-Q.git/commitdiff
Check that all elements in the assignment array are present in acidobazic suite
authorMichal Malý <madcatxster@devoid-pointer.net>
Fri, 19 Dec 2014 01:05:54 +0000 (02:05 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Fri, 19 Dec 2014 01:05:54 +0000 (02:05 +0100)
src/face_generators/face_generator.adb

index ae8a18412bfe45eed7d8066fcfda5db0fef346c6..f27a4a789bbf1432e432a24e5f45793f882eb0f2 100644 (file)
@@ -131,13 +131,41 @@ package body Face_Generator is
     Insert(Translations, Assoc(RESERVED_PROBLEM_ID_VAL_KEY, Pr_ID));
     Insert(Translations, Assoc(RESERVED_PROBLEM_CATEGORY_KEY, RESERVED_PROBLEM_CATEGORY_KEY));
     Insert(Translations, Assoc(RESERVED_PROBLEM_CATEGORY_VAL_KEY, Pr_Cat));
+    if Assignment.Find(Acidobazic_Suite.CONCENTRATION_INT_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.CONCENTRATION_INT_KEY, Assignment.Element(Acidobazic_Suite.CONCENTRATION_INT_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.CONCENTRATION_DEC_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.CONCENTRATION_DEC_KEY, Assignment.Element(Acidobazic_Suite.CONCENTRATION_DEC_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.CONCENTRATION_EXP_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.CONCENTRATION_EXP_KEY, Assignment.Element(Acidobazic_Suite.CONCENTRATION_EXP_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.PKX_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.PKX_KEY, Assignment.Element(Acidobazic_Suite.PKX_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.PKX_VALUE_INT_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.PKX_VALUE_INT_KEY, Assignment.Element(Acidobazic_Suite.PKX_VALUE_INT_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.PKX_VALUE_DEC_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.PKX_VALUE_DEC_KEY, Assignment.Element(Acidobazic_Suite.PKX_VALUE_DEC_KEY)));
+
+    if Assignment.Find(Acidobazic_Suite.SUBSTANCE_KEY) = Assignment_Info.No_Element then
+      return E_INVAL;
+    end if;
     Insert(Translations, Assoc(Acidobazic_Suite.SUBSTANCE_KEY, Assignment.Element(Acidobazic_Suite.SUBSTANCE_KEY)));
+
     Insert(Translations, Assoc("ANSWER_PH", Acidobazic_Suite.ANSWER_PH_KEY));
     Insert(Translations, Assoc("ANSWER_SIMPLIFICATION", Acidobazic_Suite.ANSWER_SIMPLIFICATION_KEY));
     Insert(Translations, Assoc("ANSWER_OPTION_SIMPL_ATPR", Acidobazic_Suite.Simplification'Image(Acidobazic_Suite.Autoprotolysis)));