From: Tim King Date: Mon, 1 Mar 2010 20:19:48 +0000 (+0000) Subject: Node builder tests that targetted properly detecting and handling expections have... X-Git-Tag: cvc5-1.0.0~9209 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11236f077a684261f2b260e7333ba8409245ba87;p=cvc5.git Node builder tests that targetted properly detecting and handling expections have been changed to be debug mode. (The Assert(..) calls these checks rely on get compiled out of production mode.) Production and debug mode should now both pass make check on everything. --- diff --git a/test/unit/expr/node_builder_black.h b/test/unit/expr/node_builder_black.h index e956806b8..8aff0faf0 100644 --- a/test/unit/expr/node_builder_black.h +++ b/test/unit/expr/node_builder_black.h @@ -240,8 +240,9 @@ public: Node n = noKind; +#ifdef CVC4_DEBUG TS_ASSERT_THROWS_ANYTHING(noKind.getKind();); - +#endif NodeBuilder<> spec(specKind); @@ -274,9 +275,11 @@ public: push_back(noKind, K); TS_ASSERT_EQUALS(noKind.getNumChildren(), K+K); +#ifdef CVC4_DEBUG noKind << specKind; n = noKind; TS_ASSERT_THROWS_ANYTHING( noKind.getNumChildren() ); +#endif } void testOperatorSquare(){ @@ -293,9 +296,10 @@ public: Node i_K = d_nm->mkNode(NOT); +#ifdef CVC4_DEBUG TS_ASSERT_THROWS_ANYTHING(arr[-1];); TS_ASSERT_THROWS_ANYTHING(arr[0];); - +#endif arr << i_0; @@ -322,15 +326,16 @@ public: for(int i=3;i nb; - TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND); TS_ASSERT_EQUALS(nb.getNumChildren(), 0); TS_ASSERT_EQUALS(nb.begin(), nb.end()); @@ -376,8 +381,10 @@ public: void testStreamInsertionKind(){ /* NodeBuilder& operator<<(const Kind& k); */ +#ifdef CVC4_DEBUG NodeBuilder<> spec(specKind); TS_ASSERT_THROWS_ANYTHING( spec << PLUS; ); +#endif NodeBuilder<> noSpec; noSpec << specKind; @@ -392,14 +399,18 @@ public: NodeBuilder<> nb(specKind); Node n = nb;// avoid warning on clear() nb.clear(PLUS); + +#ifdef CVC4_DEBUG TS_ASSERT_THROWS_ANYTHING( nb << PLUS; ); +#endif NodeBuilder<> testRef; TS_ASSERT_EQUALS((testRef << specKind).getKind(), specKind); - +#ifdef CVC4_DEBUG NodeBuilder<> testTwo; TS_ASSERT_THROWS_ANYTHING(testTwo << specKind << PLUS;); +#endif NodeBuilder<> testMixOrder1; TS_ASSERT_EQUALS((testMixOrder1<< specKind << d_nm->mkNode(TRUE)).getKind(), @@ -420,9 +431,10 @@ public: TS_ASSERT_EQUALS(nb.getNumChildren(), K); TS_ASSERT_DIFFERS(nb.begin(), nb.end()); +#ifdef CVC4_DEBUG Node n = nb; TS_ASSERT_THROWS_ANYTHING(nb << n;); - +#endif NodeBuilder<> overflow(specKind); TS_ASSERT_EQUALS(overflow.getKind(), specKind); @@ -504,7 +516,9 @@ public: TS_ASSERT_EQUALS(nexplicit.getKind(), specKind); TS_ASSERT_EQUALS(nexplicit.getNumChildren(), K); +#ifdef CVC4_DEBUG TS_ASSERT_THROWS_ANYTHING(Node blah = implicit); +#endif } void testToStream(){