You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(121) |
Aug
(343) |
Sep
(98) |
Oct
(55) |
Nov
(158) |
Dec
(219) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(278) |
Feb
(170) |
Mar
(286) |
Apr
(32) |
May
(83) |
Jun
(140) |
Jul
(212) |
Aug
(242) |
Sep
(52) |
Oct
(29) |
Nov
(132) |
Dec
(259) |
| 2010 |
Jan
(251) |
Feb
(147) |
Mar
(76) |
Apr
(140) |
May
(43) |
Jun
(66) |
Jul
(273) |
Aug
(205) |
Sep
(260) |
Oct
(100) |
Nov
(58) |
Dec
(264) |
| 2011 |
Jan
(219) |
Feb
(344) |
Mar
(320) |
Apr
(334) |
May
(125) |
Jun
(131) |
Jul
(195) |
Aug
(155) |
Sep
(55) |
Oct
(261) |
Nov
(286) |
Dec
(216) |
| 2012 |
Jan
(188) |
Feb
(177) |
Mar
(39) |
Apr
(179) |
May
(148) |
Jun
(43) |
Jul
(229) |
Aug
(104) |
Sep
(76) |
Oct
(82) |
Nov
(93) |
Dec
(180) |
| 2013 |
Jan
(323) |
Feb
(335) |
Mar
(35) |
Apr
(220) |
May
(238) |
Jun
(122) |
Jul
(316) |
Aug
(73) |
Sep
(135) |
Oct
(515) |
Nov
(320) |
Dec
(185) |
| 2014 |
Jan
(81) |
Feb
(146) |
Mar
(337) |
Apr
(234) |
May
(112) |
Jun
(239) |
Jul
(323) |
Aug
(123) |
Sep
(83) |
Oct
(285) |
Nov
(321) |
Dec
(96) |
| 2015 |
Jan
(77) |
Feb
(79) |
Mar
(124) |
Apr
(71) |
May
(35) |
Jun
(45) |
Jul
(77) |
Aug
(44) |
Sep
(22) |
Oct
(84) |
Nov
(120) |
Dec
(37) |
| 2016 |
Jan
(38) |
Feb
(74) |
Mar
(242) |
Apr
(153) |
May
(59) |
Jun
(44) |
Jul
(67) |
Aug
(74) |
Sep
(150) |
Oct
(35) |
Nov
(69) |
Dec
(43) |
| 2017 |
Jan
(43) |
Feb
(9) |
Mar
(274) |
Apr
(40) |
May
(81) |
Jun
(81) |
Jul
(87) |
Aug
(46) |
Sep
(98) |
Oct
(50) |
Nov
(220) |
Dec
(66) |
| 2018 |
Jan
(110) |
Feb
(22) |
Mar
(20) |
Apr
(147) |
May
(148) |
Jun
(30) |
Jul
(83) |
Aug
(63) |
Sep
(40) |
Oct
(53) |
Nov
(51) |
Dec
(104) |
| 2019 |
Jan
(14) |
Feb
(81) |
Mar
(80) |
Apr
(102) |
May
(16) |
Jun
(5) |
Jul
(34) |
Aug
(24) |
Sep
(9) |
Oct
(12) |
Nov
(42) |
Dec
(76) |
| 2020 |
Jan
(15) |
Feb
(11) |
Mar
(12) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(13) |
2
(40) |
|
3
(50) |
4
(32) |
5
(18) |
6
(7) |
7
(10) |
8
(10) |
9
|
|
10
|
11
(1) |
12
(7) |
13
(1) |
14
(31) |
15
(7) |
16
|
|
17
(8) |
18
(8) |
19
(17) |
20
(10) |
21
(5) |
22
|
23
|
|
24
|
25
|
26
(5) |
27
(19) |
28
(15) |
29
(5) |
30
(1) |
|
From: <mh...@us...> - 2013-11-30 04:29:26
|
Revision: 19311
http://sourceforge.net/p/sbml/code/19311
Author: mhucka
Date: 2013-11-30 04:29:21 +0000 (Sat, 30 Nov 2013)
Log Message:
-----------
Need to delete the archive zip file after unpacking it.
Modified Paths:
--------------
trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java
Modified: trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java
===================================================================
--- trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java 2013-11-29 21:59:49 UTC (rev 19310)
+++ trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java 2013-11-30 04:29:21 UTC (rev 19311)
@@ -525,6 +525,8 @@
/**
* Unpack the archive pointed to by @p file, which is assumed to be a
* zip archive of SBML Test Suite test cases.
+ *
+ * @returns true if successfully unpacked the archive, false otherwise
*/
public boolean unpackArchive(File file)
{
@@ -821,7 +823,17 @@
// Now unpack it.
if (unpackArchive(destFile))
+ {
internalCasesDate = getInternalCasesDate();
+ try
+ {
+ destFile.delete();
+ }
+ catch (Exception ex)
+ {
+ // Nothing else to do if we fail here.
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2013-11-29 21:59:51
|
Revision: 19310
http://sourceforge.net/p/sbml/code/19310
Author: mhucka
Date: 2013-11-29 21:59:49 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
1. At some point I screwed up the return value of getCaseArchiveURLs(), and it actually never returned the results. Fixed.
2. Added a sample of the rss feed format, as a comment to one of the methods. This is for future reference.
Modified Paths:
--------------
trunk/test-suite/src/front-ends/standalone/testsuite-core/src/org/sbml/testsuite/core/Util.java
Modified: trunk/test-suite/src/front-ends/standalone/testsuite-core/src/org/sbml/testsuite/core/Util.java
===================================================================
--- trunk/test-suite/src/front-ends/standalone/testsuite-core/src/org/sbml/testsuite/core/Util.java 2013-11-29 12:06:31 UTC (rev 19309)
+++ trunk/test-suite/src/front-ends/standalone/testsuite-core/src/org/sbml/testsuite/core/Util.java 2013-11-29 21:59:49 UTC (rev 19310)
@@ -167,7 +167,64 @@
*
* Callers can cache this value and use it in subsequent calls to other
* methods like getCaseArchiveURLs(...), to reduce network accesses.
- * Users on slow network links may appreciate that.
+ * (Users on slow network links may appreciate that.)
+ *
+ * For programming reference purposes, here is a sample of the RSS feed
+ * contents returned by sf.net (in Nov. 2013):
+ *
+ * <?xml version="1.0" encoding="utf-8"?>
+ * <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:files="http://sourceforge.net/api/files.rdf#" xmlns:media="http://video.search.yahoo.com/mrss/" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:sf="http://sourceforge.net/api/sfelements.rdf#" version="2.0">
+ * <channel xmlns:files="http://sourceforge.net/api/files.rdf#" xmlns:media="http://video.search.yahoo.com/mrss/" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:sf="http://sourceforge.net/api/sfelements.rdf#">
+ * <title><![CDATA[Systems Biology Markup Language (SBML) downloads]]></title>
+ * <link>http://sourceforge.net/api/file/index/project-id/71971/mtime/desc/limit/100/path/test-suite/rss</link>
+ * <description><![CDATA[Files from Systems Biology Markup Language (SBML). The Systems Biology Markup Language (SBML) is an XML-based description language for representing computational models in systems biology. Visit the project web site to learn more.]]></description>
+ * <pubDate>Sat, 23 Nov 2013 22:06:35 +0000</pubDate>
+ * <managingEditor>no...@so... (SourceForge.net)</managingEditor>
+ * <generator>Zend_Feed</generator>
+ * <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+ * <item>
+ * <title><![CDATA[/test-suite/3.0.0/cases-archive]]></title>
+ * <link>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/</link>
+ * <guid>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/</guid>
+ * <description><![CDATA[/test-suite/3.0.0/cases-archive]]></description>
+ * <pubDate>Fri, 17 May 2013 19:38:31 +0000</pubDate>
+ * <files:sf-file-id xmlns:files="http://sourceforge.net/api/files.rdf#">8337375</files:sf-file-id>
+ * <media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="" url="http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/download" filesize=""><media:title>test-suite</media:title><media:hash algo="md5"></media:hash></media:content>
+ * </item>
+ * <item>
+ * <title><![CDATA[/test-suite/3.0.0/cases-archive/sbml-test-cases-2013-06-06.zip]]></title>
+ * <link>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/sbml-test-cases-2013-06-06.zip/download</link>
+ * <guid>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/sbml-test-cases-2013-06-06.zip/download</guid>
+ * <description><![CDATA[/test-suite/3.0.0/cases-archive/sbml-test-cases-2013-06-06.zip]]></description>
+ * <pubDate>Thu, 06 Jun 2013 19:45:48 +0000</pubDate>
+ * <files:sf-file-id xmlns:files="http://sourceforge.net/api/files.rdf#">8485257</files:sf-file-id>
+ * <files:extra-info xmlns:files="http://sourceforge.net/api/files.rdf#">empty (Zip archive data)</files:extra-info>
+ * <media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="application/zip; charset=binary" url="http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/cases-archive/sbml-test-cases-2013-06-06.zip/download" filesize="42819933"><media:title>test-suite</media:title><media:hash algo="md5">93d19b51b33a6f0578db789fd25a146c</media:hash></media:content>
+ * </item>
+ * <item>
+ * <title><![CDATA[/test-suite/3.0.0/test-runner/linux]]></title>
+ * <link>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/</link>
+ * <guid>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/</guid>
+ * <description><![CDATA[/test-suite/3.0.0/test-runner/linux]]></description>
+ * <pubDate>Fri, 17 May 2013 19:38:49 +0000</pubDate>
+ * <files:sf-file-id xmlns:files="http://sourceforge.net/api/files.rdf#">8337381</files:sf-file-id>
+ * <media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="" url="http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/download" filesize=""><media:title>test-suite</media:title><media:hash algo="md5"></media:hash></media:content>
+ * </item>
+ * <item>
+ * <title><![CDATA[/test-suite/3.0.0/test-runner/linux/SBMLTestRunner-3.0.0-linux-x64-installer.run]]></title>
+ * <link>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/SBMLTestRunner-3.0.0-linux-x64-installer.run/download</link>
+ * <guid>http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/SBMLTestRunner-3.0.0-linux-x64-installer.run/download</guid>
+ * <description><![CDATA[/test-suite/3.0.0/test-runner/linux/SBMLTestRunner-3.0.0-linux-x64-installer.run]]></description>
+ * <pubDate>Thu, 06 Jun 2013 19:42:57 +0000</pubDate>
+ * <files:sf-file-id xmlns:files="http://sourceforge.net/api/files.rdf#">8485251</files:sf-file-id>
+ * <files:extra-info xmlns:files="http://sourceforge.net/api/files.rdf#">ELF 64-bit LSB executable, x86-64 (GNU/Linux)</files:extra-info>
+ * <media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="application/x-executable; charset=binary" url="http://sourceforge.net/projects/sbml/files/test-suite/3.0.0/test-runner/linux/SBMLTestRunner-3.0.0-linux-x64-installer.run/download" filesize="49740935"><media:title>test-suite</media:title><media:hash algo="md5">095f40dcd18829d01326f0bceadd4e1a</media:hash></media:content>
+ * </item>
+ * ...
+ * <doap:Project xmlns:doap="http://usefulinc.com/ns/doap#" name="Systems Biology Markup Language (SBML)" description="The Systems Biology Markup Language (SBML) is an XML-based description language for representing computational models in systems biology. Visit the project web site to learn more."><sf:id xmlns:sf="http://sourceforge.net/api/sfelements.rdf#">71971</sf:id></doap:Project>
+ * </channel>
+ * </rss>
+ *
*/
public static NodeList getRSSFeedContents(HttpURLConnection connection)
{
@@ -260,7 +317,7 @@
ex.printStackTrace();
return null;
}
- return null;
+ return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fbe...@us...> - 2013-11-29 12:06:34
|
Revision: 19309
http://sourceforge.net/p/sbml/code/19309
Author: fbergmann
Date: 2013-11-29 12:06:31 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
- fix a bug in the req package, that flagged the attributes as required (thus producing tons of error messages for all elements that did not use the req package)
Modified Paths:
--------------
branches/libsbml-experimental/src/sbml/packages/req/extension/RequiredElementsSBasePlugin.cpp
Modified: branches/libsbml-experimental/src/sbml/packages/req/extension/RequiredElementsSBasePlugin.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/req/extension/RequiredElementsSBasePlugin.cpp 2013-11-29 08:40:12 UTC (rev 19308)
+++ branches/libsbml-experimental/src/sbml/packages/req/extension/RequiredElementsSBasePlugin.cpp 2013-11-29 12:06:31 UTC (rev 19309)
@@ -103,14 +103,8 @@
void
RequiredElementsSBasePlugin::addExpectedAttributes(ExpectedAttributes& attributes)
{
- //
- // required attribute is not defined for SBML Level 2 or lesser.
- //
- if ( mSBMLExt->getLevel(mURI) > 2 && (!getMathOverridden().empty()) )
- {
- attributes.add("mathOverridden");
- attributes.add("coreHasAlternateMath");
- }
+ attributes.add("mathOverridden");
+ attributes.add("coreHasAlternateMath");
}
/**
@@ -122,14 +116,10 @@
{
SBasePlugin::readAttributes(attributes, expectedAttributes);
- if ( mSBMLExt->getLevel(mURI) > 2 )
- {
- XMLTriple tripleMathOverridden("mathOverridden", mURI, mPrefix);
- attributes.readInto(tripleMathOverridden, mMathOverridden, getErrorLog(), true, getLine(), getColumn());
- XMLTriple tripleAltMath("coreHasAlternateMath", mURI, mPrefix);
- attributes.readInto(tripleAltMath, mCoreHasAlternateMath, getErrorLog(), true, getLine(), getColumn());
-
- }
+ XMLTriple tripleMathOverridden("mathOverridden", mURI, mPrefix);
+ attributes.readInto(tripleMathOverridden, mMathOverridden, getErrorLog(), false, getLine(), getColumn());
+ XMLTriple tripleAltMath("coreHasAlternateMath", mURI, mPrefix);
+ attributes.readInto(tripleAltMath, mCoreHasAlternateMath, getErrorLog(), false, getLine(), getColumn());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-29 08:40:15
|
Revision: 19308
http://sourceforge.net/p/sbml/code/19308
Author: sarahkeating
Date: 2013-11-29 08:40:12 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
Merged revision(s) 19302-19307 from trunk/libsbml:
Modified Paths:
--------------
branches/libsbml-experimental/config/ruby.m4
branches/libsbml-experimental/configure
branches/libsbml-experimental/src/bindings/matlab/buildSBML.m
Added Paths:
-----------
branches/libsbml-experimental/src/bindings/matlab/mexopts-osx108.sh
branches/libsbml-experimental/src/bindings/matlab/mexopts-osx109.sh
Property Changed:
----------------
branches/libsbml-experimental/
Index: branches/libsbml-experimental
===================================================================
--- branches/libsbml-experimental 2013-11-29 08:36:28 UTC (rev 19307)
+++ branches/libsbml-experimental 2013-11-29 08:40:12 UTC (rev 19308)
Property changes on: branches/libsbml-experimental
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/L3Parser:15528-15625,15656-15673
/branches/libsbml-4:9056-10118
/branches/libsbml-5-conversion:14155-14227
-/trunk/libsbml:18168-18171,18174-18194,18196-18201,18204,18207-18209,18211-18213,18215-18216,18226,18228-18292,18294-18388,18390-18443,18450-18454,18456-18458,18460-18462,18464,18466,18469-18520,18523-18561,18563,18565-18584,18586-18638,18640-18641,18644-18715,18717-18844,18846-19128,19130-19301
+/trunk/libsbml:18168-18171,18174-18194,18196-18201,18204,18207-18209,18211-18213,18215-18216,18226,18228-18292,18294-18388,18390-18443,18450-18454,18456-18458,18460-18462,18464,18466,18469-18520,18523-18561,18563,18565-18584,18586-18638,18640-18641,18644-18715,18717-18844,18846-19128,19130-19307
\ No newline at end of property
Modified: branches/libsbml-experimental/config/ruby.m4
===================================================================
--- branches/libsbml-experimental/config/ruby.m4 2013-11-29 08:36:28 UTC (rev 19307)
+++ branches/libsbml-experimental/config/ruby.m4 2013-11-29 08:40:12 UTC (rev 19308)
@@ -76,14 +76,20 @@
RUBY_PREFIX=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['prefix']"]`
AC_MSG_RESULT($RUBY_PREFIX)
- if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""]` = "OK";
then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
+ RUBY_H=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
+ else
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
RUBY_H=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
else
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['archdir']"]`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
- fi
+ fi
+ fi
AC_MSG_CHECKING(for ruby.h)
if test -z "$RUBY_H" || ! test -f "$RUBY_H";
Modified: branches/libsbml-experimental/configure
===================================================================
--- branches/libsbml-experimental/configure 2013-11-29 08:36:28 UTC (rev 19307)
+++ branches/libsbml-experimental/configure 2013-11-29 08:40:12 UTC (rev 19308)
@@ -7188,6 +7188,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_PREFIX" >&5
$as_echo "$RUBY_PREFIX" >&6; }
+ if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""` = "OK";
+ then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
+ RUBY_H=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "`"/ruby.h"
+ else
if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""` = "OK";
then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
@@ -7196,6 +7201,7 @@
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; puts CONFIG['archdir']"`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby.h" >&5
$as_echo_n "checking for ruby.h... " >&6; }
@@ -9740,7 +9746,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 9743 "configure"' > conftest.$ac_ext
+ echo '#line 9749 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -11958,11 +11964,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11961: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11967: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11965: \$? = $ac_status" >&5
+ echo "$as_me:11971: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12248,11 +12254,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12251: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12257: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12255: \$? = $ac_status" >&5
+ echo "$as_me:12261: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12352,11 +12358,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12355: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12361: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12359: \$? = $ac_status" >&5
+ echo "$as_me:12365: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14377,7 +14383,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14380 "configure"
+#line 14386 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14477,7 +14483,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14480 "configure"
+#line 14486 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16822,11 +16828,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16825: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16831: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16829: \$? = $ac_status" >&5
+ echo "$as_me:16835: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16926,11 +16932,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16929: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16935: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16933: \$? = $ac_status" >&5
+ echo "$as_me:16939: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18509,11 +18515,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18512: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18518: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18516: \$? = $ac_status" >&5
+ echo "$as_me:18522: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -18613,11 +18619,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18616: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18622: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18620: \$? = $ac_status" >&5
+ echo "$as_me:18626: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20783,11 +20789,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:20786: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:20792: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:20790: \$? = $ac_status" >&5
+ echo "$as_me:20796: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21073,11 +21079,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21076: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21082: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21080: \$? = $ac_status" >&5
+ echo "$as_me:21086: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21177,11 +21183,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21180: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21186: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21184: \$? = $ac_status" >&5
+ echo "$as_me:21190: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Modified: branches/libsbml-experimental/src/bindings/matlab/buildSBML.m
===================================================================
--- branches/libsbml-experimental/src/bindings/matlab/buildSBML.m 2013-11-29 08:36:28 UTC (rev 19307)
+++ branches/libsbml-experimental/src/bindings/matlab/buildSBML.m 2013-11-29 08:40:12 UTC (rev 19308)
@@ -643,7 +643,7 @@
disp(sprintf('* Creating mex files in %s', pwd));
% list the possible opts files to be tried
- optsfiles = {'', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
+ optsfiles = {'', './mexopts-osx109.sh', './mexopts-osx108.sh', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
success = 0;
n = 1;
Copied: branches/libsbml-experimental/src/bindings/matlab/mexopts-osx108.sh (from rev 19307, trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh)
===================================================================
--- branches/libsbml-experimental/src/bindings/matlab/mexopts-osx108.sh (rev 0)
+++ branches/libsbml-experimental/src/bindings/matlab/mexopts-osx108.sh 2013-11-29 08:40:12 UTC (rev 19308)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Copied: branches/libsbml-experimental/src/bindings/matlab/mexopts-osx109.sh (from rev 19307, trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh)
===================================================================
--- branches/libsbml-experimental/src/bindings/matlab/mexopts-osx109.sh (rev 0)
+++ branches/libsbml-experimental/src/bindings/matlab/mexopts-osx109.sh 2013-11-29 08:40:12 UTC (rev 19308)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-29 08:36:32
|
Revision: 19307
http://sourceforge.net/p/sbml/code/19307
Author: sarahkeating
Date: 2013-11-29 08:36:28 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
Merged revision(s) 19251-19306 from trunk/libsbml:
Property Changed:
----------------
branches/libsbml-ast-plugin/
Index: branches/libsbml-ast-plugin
===================================================================
--- branches/libsbml-ast-plugin 2013-11-29 08:29:50 UTC (rev 19306)
+++ branches/libsbml-ast-plugin 2013-11-29 08:36:28 UTC (rev 19307)
Property changes on: branches/libsbml-ast-plugin
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/L3Parser:15528-15625,15656-15673
/branches/libsbml-4:9056-10118
/branches/libsbml-5-conversion:14155-14227
-/trunk/libsbml:16238-19219,19223-19305
+/trunk/libsbml:16238-19219,19223-19306
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-29 08:29:54
|
Revision: 19306
http://sourceforge.net/p/sbml/code/19306
Author: sarahkeating
Date: 2013-11-29 08:29:50 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
Modified Paths:
--------------
branches/libsbml-ast-plugin/CMakeLists.txt
branches/libsbml-ast-plugin/NEWS.txt
branches/libsbml-ast-plugin/config/ruby.m4
branches/libsbml-ast-plugin/configure
branches/libsbml-ast-plugin/src/bindings/matlab/buildSBML.m
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.cpp
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.h
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.cpp
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.h
branches/libsbml-ast-plugin/src/sbml/packages/comp/util/test/TestURIResolvers.cpp
Added Paths:
-----------
branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx108.sh
branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx109.sh
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestDeletion.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestModelDefinition.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestReplacedBy.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestReplacedElement.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestSBaseRef.c
branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestSubmodel.c
Property Changed:
----------------
branches/libsbml-ast-plugin/
Index: branches/libsbml-ast-plugin
===================================================================
--- branches/libsbml-ast-plugin 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin 2013-11-29 08:29:50 UTC (rev 19306)
Property changes on: branches/libsbml-ast-plugin
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/L3Parser:15528-15625,15656-15673
/branches/libsbml-4:9056-10118
/branches/libsbml-5-conversion:14155-14227
-/trunk/libsbml:16238-19219,19223-19250
+/trunk/libsbml:16238-19219,19223-19305
\ No newline at end of property
Modified: branches/libsbml-ast-plugin/CMakeLists.txt
===================================================================
--- branches/libsbml-ast-plugin/CMakeLists.txt 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/CMakeLists.txt 2013-11-29 08:29:50 UTC (rev 19306)
@@ -288,6 +288,7 @@
find_path(LIBEXPAT_INCLUDE_DIR
NAMES expat.h
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the Expat include files."
)
@@ -321,6 +322,7 @@
NAMES libxml/parser.h
PATHS /usr/include /usr/local/include
/usr/include/libxml2
+ ${CMAKE_OSX_SYSROOT}/usr/include/libxml2
/usr/local/include/libxml2
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the libxml2 include files."
@@ -356,6 +358,7 @@
find_path(XERCES_INCLUDE_DIR
NAMES xercesc/parsers/XercesDOMParser.hpp
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include/xercesc
/usr/include/xercesc
/usr/local/include/xercesc
${LIBSBML_DEPENDENCY_DIR}/include
@@ -382,6 +385,7 @@
find_library(LIBBZ_LIBRARY
NAMES bzip2.lib bz2 libbz2.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the bzip2 library."
)
@@ -398,10 +402,21 @@
find_path(LIBBZ_INCLUDE_DIR
NAMES bzlib.h bzip2/bzlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the bzip2 include files."
)
+ if (NOT LIBBZ_INCLUDE_DIR)
+ find_path(LIBBZ_INCLUDE_DIR
+ NAMES bzlib.h bzip2/bzlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the bzip2 include files."
+ )
+ endif()
set(USE_BZ2 ON)
add_definitions( -DUSE_BZ2 )
@@ -442,6 +457,7 @@
find_library(LIBZ_LIBRARY
NAMES zdll.lib z zlib.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the zip compression library."
)
@@ -458,10 +474,21 @@
find_path(LIBZ_INCLUDE_DIR
NAMES zlib.h zlib/zlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the zlib include files."
)
+ if (NOT LIBZ_INCLUDE_DIR)
+ find_path(LIBZ_INCLUDE_DIR
+ NAMES zlib.h zlib/zlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the zlib include files."
+ )
+ endif()
set(USE_ZLIB ON)
add_definitions( -DUSE_ZLIB )
@@ -704,6 +731,7 @@
find_library(LIBICONV_LIBRARY
NAMES libiconv.lib iconv.lib iconv
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the libiconv library."
)
Modified: branches/libsbml-ast-plugin/NEWS.txt
===================================================================
--- branches/libsbml-ast-plugin/NEWS.txt 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/NEWS.txt 2013-11-29 08:29:50 UTC (rev 19306)
@@ -1,6 +1,80 @@
libSBML NEWS -- History of user-visible changes
+====================================================================
+Next release ...
+====================================================================
+STABLE RELEASE
+
+* New features
+
+ - 'comp' package-specific updates:
+
+ - 'fbc' package-specific updates:
+
+ - 'layout' package-specific updates:
+
+ - 'qual' package-specific updates:
+
+* Bug fixes
+
+ - The Borland compiler does not handle implicit casts and
+ unfortunately there was one such cast in the new code introduced
+ for 5.9.0. This has now been fixed. Thanks to Totte Karlsson for
+ reporting it.
+
+ - A memory leak in SBasePluiginCreator has been plugged. Thanks to
+ Andy Somogyi for reporting it.
+
+ - 'comp' package-specific updates:
+
+ - 'fbc' package-specific updates:
+
+ - The CobraToFbcConverter was losing the charge and the
+ capitalization of the formula when parsing the notes element.
+ This has been fixed.
+
+ - 'layout' package-specific updates:
+
+ - 'qual' package-specific updates:
+
+* Configuration/build system changes
+
+
+* Miscellaneous
+
+
+EXPERIMENTAL RELEASE
+
+* New features
+
+ - 'distrib' package-specific updates:
+
+ - 'groups' package-specific updates:
+
+ - 'multi' package-specific updates:
+
+ - 'render' package-specific updates:
+
+ - 'req' package-specific updates:
+
+ - 'spatial' package-specific updates:
+
+* Bug fixes
+
+ - 'distrib' package-specific updates:
+
+ - 'groups' package-specific updates:
+
+ - 'multi' package-specific updates:
+
+ - 'render' package-specific updates:
+
+ - 'req' package-specific updates:
+
+ - 'spatial' package-specific updates:
+
+
====================================================================
Version 5.9.0 (2013-11-14)
====================================================================
Modified: branches/libsbml-ast-plugin/config/ruby.m4
===================================================================
--- branches/libsbml-ast-plugin/config/ruby.m4 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/config/ruby.m4 2013-11-29 08:29:50 UTC (rev 19306)
@@ -76,14 +76,20 @@
RUBY_PREFIX=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['prefix']"]`
AC_MSG_RESULT($RUBY_PREFIX)
- if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""]` = "OK";
then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
+ RUBY_H=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
+ else
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
RUBY_H=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
else
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['archdir']"]`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
- fi
+ fi
+ fi
AC_MSG_CHECKING(for ruby.h)
if test -z "$RUBY_H" || ! test -f "$RUBY_H";
Modified: branches/libsbml-ast-plugin/configure
===================================================================
--- branches/libsbml-ast-plugin/configure 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/configure 2013-11-29 08:29:50 UTC (rev 19306)
@@ -7188,6 +7188,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_PREFIX" >&5
$as_echo "$RUBY_PREFIX" >&6; }
+ if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""` = "OK";
+ then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
+ RUBY_H=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "`"/ruby.h"
+ else
if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""` = "OK";
then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
@@ -7196,6 +7201,7 @@
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; puts CONFIG['archdir']"`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby.h" >&5
$as_echo_n "checking for ruby.h... " >&6; }
@@ -9740,7 +9746,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 9743 "configure"' > conftest.$ac_ext
+ echo '#line 9749 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -11958,11 +11964,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11961: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11967: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11965: \$? = $ac_status" >&5
+ echo "$as_me:11971: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12248,11 +12254,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12251: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12257: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12255: \$? = $ac_status" >&5
+ echo "$as_me:12261: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12352,11 +12358,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12355: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12361: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12359: \$? = $ac_status" >&5
+ echo "$as_me:12365: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14377,7 +14383,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14380 "configure"
+#line 14386 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14477,7 +14483,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14480 "configure"
+#line 14486 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16822,11 +16828,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16825: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16831: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16829: \$? = $ac_status" >&5
+ echo "$as_me:16835: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16926,11 +16932,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16929: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16935: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16933: \$? = $ac_status" >&5
+ echo "$as_me:16939: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18509,11 +18515,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18512: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18518: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18516: \$? = $ac_status" >&5
+ echo "$as_me:18522: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -18613,11 +18619,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18616: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18622: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18620: \$? = $ac_status" >&5
+ echo "$as_me:18626: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20783,11 +20789,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:20786: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:20792: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:20790: \$? = $ac_status" >&5
+ echo "$as_me:20796: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21073,11 +21079,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21076: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21082: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21080: \$? = $ac_status" >&5
+ echo "$as_me:21086: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21177,11 +21183,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21180: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21186: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21184: \$? = $ac_status" >&5
+ echo "$as_me:21190: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Modified: branches/libsbml-ast-plugin/src/bindings/matlab/buildSBML.m
===================================================================
--- branches/libsbml-ast-plugin/src/bindings/matlab/buildSBML.m 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/src/bindings/matlab/buildSBML.m 2013-11-29 08:29:50 UTC (rev 19306)
@@ -643,7 +643,7 @@
disp(sprintf('* Creating mex files in %s', pwd));
% list the possible opts files to be tried
- optsfiles = {'', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
+ optsfiles = {'', './mexopts-osx109.sh', './mexopts-osx108.sh', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
success = 0;
n = 1;
Copied: branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx108.sh (from rev 19305, trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh)
===================================================================
--- branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx108.sh (rev 0)
+++ branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx108.sh 2013-11-29 08:29:50 UTC (rev 19306)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Copied: branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx109.sh (from rev 19305, trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh)
===================================================================
--- branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx109.sh (rev 0)
+++ branches/libsbml-ast-plugin/src/bindings/matlab/mexopts-osx109.sh 2013-11-29 08:29:50 UTC (rev 19306)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Modified: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-29 08:29:50 UTC (rev 19306)
@@ -195,5 +195,41 @@
}
/** @endcond */
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion)
+{
+ return new ModelDefinition(level, version, pkgVersion);
+}
+
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ delete md;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ {
+ return static_cast<ModelDefinition_t*>(md->clone());
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-29 08:29:50 UTC (rev 19306)
@@ -196,7 +196,23 @@
//
// C API will be added here.
//
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion);
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * emd);
+
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * emd);
+
+
+
+
END_C_DECLS
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-29 08:29:50 UTC (rev 19306)
@@ -1438,6 +1438,20 @@
*/
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s)
+{
+ if (s == NULL)
+ return NULL;
+
+ return s->getSubstanceConversionFactor().empty() ? NULL : safe_strdup(s->getSubstanceConversionFactor().c_str());
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s)
{
if (s == NULL)
@@ -1499,6 +1513,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? static_cast<int>(s->isSetSubstanceConversionFactor()) : 0;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? static_cast<int>(s->isSetTimeConversionFactor()) : 0;
@@ -1554,6 +1579,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor)
+{
+ return (s != NULL) ? s->setSubstanceConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor)
{
return (s != NULL) ? s->setTimeConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
@@ -1609,6 +1645,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? s->unsetSubstanceConversionFactor() : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? s->unsetTimeConversionFactor() : LIBSBML_INVALID_OBJECT;
Modified: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.h 2013-11-28 17:34:01 UTC (rev 19305)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/Submodel.h 2013-11-29 08:29:50 UTC (rev 19306)
@@ -879,6 +879,11 @@
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s);
@@ -904,6 +909,11 @@
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s);
@@ -929,6 +939,11 @@
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor);
+
+
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor);
@@ -954,6 +969,11 @@
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s);
Copied: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestDeletion.c (from rev 19305, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c)
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestDeletion.c (rev 0)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestDeletion.c 2013-11-29 08:29:50 UTC (rev 19306)
@@ -0,0 +1,191 @@
+/**
+ * \file TestDeletion.c
+ * \brief Deletion unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/Deletion.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static Deletion_t *P;
+
+
+void
+DeletionTest_setup (void)
+{
+ P = Deletion_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("Deletion_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+DeletionTest_teardown (void)
+{
+ Deletion_free(P);
+}
+
+
+START_TEST (test_comp_deletion_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_DELETION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( Deletion_getId (P) == NULL );
+ fail_unless( Deletion_getName (P) == NULL );
+
+ fail_unless( !Deletion_isSetId (P) );
+ fail_unless( !Deletion_isSetName (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_free_NULL)
+{
+ Deletion_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ Deletion_setId(P, id);
+
+ fail_unless( !strcmp(Deletion_getId(P), id) );
+ fail_unless( Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) == id)
+ {
+ fail("Deletion_setId(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetId(P);
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) != NULL)
+ {
+ fail("Deletion_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ Deletion_setName(P, name);
+
+ fail_unless( !strcmp(Deletion_getName(P), name) );
+ fail_unless( Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) == name)
+ {
+ fail("Deletion_setName(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetName(P);
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) != NULL)
+ {
+ fail("Deletion_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_hasRequiredAttributes )
+{
+ Deletion_t *P = Deletion_create (3, 1, 1);
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ Deletion_setId(P, "p");
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( Deletion_hasRequiredAttributes(P));
+
+ Deletion_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_Deletion (void)
+{
+ Suite *suite = suite_create("comp_deletion");
+ TCase *tcase = tcase_create("comp_deletion");
+
+
+ tcase_add_checked_fixture( tcase,
+ DeletionTest_setup,
+ DeletionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_deletion_create );
+ tcase_add_test( tcase, test_comp_deletion_free_NULL );
+ tcase_add_test( tcase, test_comp_deletion_id );
+ tcase_add_test( tcase, test_comp_deletion_name );
+ tcase_add_test( tcase, test_comp_deletion_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c (from rev 19305, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c)
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c (rev 0)
+++ branches/libsbml-ast-plugin/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c 2013-11-29 08:29:50 UTC (rev 19306)
@@ -0,0 +1,255 @@
+/**
+ * \file TestExternalModelDefinition.c
+ * \brief ExternalModelDefinition unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ExternalModelDefinition.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ExternalModelDefinition_t *P;
+
+
+void
+ExternalModelDefinitionTest_setup (void)
+{
+ P = ExternalModelDefinition_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ExternalModelDefinition_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ExternalModelDefinitionTest_teardown (void)
+{
+ ExternalModelDefinition_free(P);
+}
+
+
+START_TEST (test_comp_externalModelDefinition_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_EXTERNALMODELDEFINITION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ExternalModelDefinition_getId (P) == NULL );
+ fail_unless( ExternalModelDefinition_getName (P) == NULL );
+ fail_unless( ExternalModelDefinition_getModelRef (P) == NULL );
+ fail_unless( ExternalModelDefinition_getSource (P) == NULL );
+
+ fail_unless( !ExternalModelDefinition_isSetId (P) );
+ fail_unless( !ExternalModelDefinition_isSetName (P) );
+ fail_unless( !ExternalModelDefinition_isSetModelRef (P) );
+ fail_unless( !ExternalModelDefinition_isSetSource (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_free_NULL)
+{
+ ExternalModelDefinition_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ ExternalModelDefinition_setId(P, id);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getId(P), id) );
+ fail_unless( ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_getId(P) == id)
+ {
+ fail("ExternalModelDefinition_setId(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetId(P);
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_ge...
[truncated message content] |
|
From: <fbe...@us...> - 2013-11-28 17:34:06
|
Revision: 19305
http://sourceforge.net/p/sbml/code/19305
Author: fbergmann
Date: 2013-11-28 17:34:01 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
- added new test file
Added Paths:
-----------
branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/test-data/ImageTest2.xml
Added: branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/test-data/ImageTest2.xml
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/test-data/ImageTest2.xml (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/test-data/ImageTest2.xml 2013-11-28 17:34:01 UTC (rev 19305)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:req="http://www.sbml.org/sbml/level3/version1/requiredElements/version1" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1" level="3" version="1" req:required="true" spatial:required="true">
+ <model id="BioModel1_Application0" name="BioModel1_Application0">
+ <annotation>
+ <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell">
+ <vcell:VCMLSpecific>
+ <vcell:BioModel Name="BioModel1"/>
+ <vcell:SimulationSpec Name="Application0"/>
+ </vcell:VCMLSpecific>
+ </vcell:VCellInfo>
+ </annotation>
+ <listOfUnitDefinitions>
+ <unitDefinition id="substance">
+ <listOfUnits>
+ <unit kind="mole" exponent="1" scale="0" multiplier="1"/>
+ </listOfUnits>
+ </unitDefinition>
+ <unitDefinition id="volume">
+ <listOfUnits>
+ <unit kind="metre" exponent="3" scale="0" multiplier="0.1"/>
+ </listOfUnits>
+ </unitDefinition>
+ <unitDefinition id="area">
+ <listOfUnits>
+ <unit kind="metre" exponent="2" scale="0" multiplier="1"/>
+ </listOfUnits>
+ </unitDefinition>
+ <unitDefinition id="length">
+ <listOfUnits>
+ <unit kind="metre" exponent="1" scale="0" multiplier="1"/>
+ </listOfUnits>
+ </unitDefinition>
+ <unitDefinition id="time">
+ <listOfUnits>
+ <unit kind="second" exponent="1" scale="0" multiplier="1"/>
+ </listOfUnits>
+ </unitDefinition>
+ <unitDefinition id="mol">
+ <listOfUnits>
+ <unit kind="mole" exponent="1" scale="0" multiplier="1"/>
+ </listOfUnits>
+ </unitDefinition>
+ </listOfUnitDefinitions>
+ <listOfCompartments>
+ <compartment id="c0" name="c0" spatialDimensions="3" size="50000" units="litre" constant="true">
+ <spatial:compartmentMapping spatial:spatialId="backgroundc0" spatial:compartment="c0" spatial:domainType="background" spatial:unitSize="1"/>
+ </compartment>
+ <compartment id="c1" name="c1" spatialDimensions="3" size="5000" units="litre" constant="true">
+ <annotation>
+ <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell">
+ <vcell:VCMLSpecific>
+ <vcell:OutsideCompartment Name="Membrane0"/>
+ </vcell:VCMLSpecific>
+ </vcell:VCellInfo>
+ </annotation>
+ <spatial:compartmentMapping spatial:spatialId="roi_237c1" spatial:compartment="c1" spatial:domainType="roi_237" spatial:unitSize="1"/>
+ </compartment>
+ <compartment id="c2" name="c2" spatialDimensions="3" size="500" units="litre" constant="true">
+ <annotation>
+ <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell">
+ <vcell:VCMLSpecific>
+ <vcell:OutsideCompartment Name="Membrane1"/>
+ </vcell:VCMLSpecific>
+ </vcell:VCellInfo>
+ </annotation>
+ <spatial:compartmentMapping spatial:spatialId="roi_255c2" spatial:compartment="c2" spatial:domainType="roi_255" spatial:unitSize="1"/>
+ </compartment>
+ <compartment id="Membrane0" name="Membrane0" spatialDimensions="2" size="1414" units="m2" constant="true">
+ <annotation>
+ <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell">
+ <vcell:VCMLSpecific>
+ <vcell:OutsideCompartment Name="c0"/>
+ </vcell:VCMLSpecific>
+ </vcell:VCellInfo>
+ </annotation>
+ <spatial:compartmentMapping spatial:spatialId="background_roi_237_membraneMembrane0" spatial:compartment="Membrane0" spatial:domainType="background_roi_237_membrane" spatial:unitSize="1"/>
+ </compartment>
+ <compartment id="Membrane1" name="Membrane1" spatialDimensions="2" size="304.6" units="m2" constant="true">
+ <annotation>
+ <vcell:VCellInfo xmlns:vcell="http://sourceforge.net/projects/vcell">
+ <vcell:VCMLSpecific>
+ <vcell:OutsideCompartment Name="c1"/>
+ </vcell:VCMLSpecific>
+ </vcell:VCellInfo>
+ </annotation>
+ <spatial:compartmentMapping spatial:spatialId="roi_237_roi_255_membraneMembrane1" spatial:compartment="Membrane1" spatial:domainType="roi_237_roi_255_membrane" spatial:unitSize="1"/>
+ </compartment>
+ </listOfCompartments>
+ <listOfParameters>
+ <parameter id="x" value="0" req:mathOverridden="spatial" req:coreHasAlternateMath="false">
+ <spatial:spatialSymbolReference spatial:spatialId="x" spatial:type="coordinateComponent"/>
+ </parameter>
+ <parameter id="y" value="0" req:mathOverridden="spatial" req:coreHasAlternateMath="false">
+ <spatial:spatialSymbolReference spatial:spatialId="y" spatial:type="coordinateComponent"/>
+ </parameter>
+ </listOfParameters>
+ <spatial:geometry spatial:coordinateSystem="Cartesian">
+ <spatial:listOfCoordinateComponents>
+ <spatial:coordinateComponent spatial:spatialId="x" spatial:componentType="cartesianX" spatial:sbmlUnit="m" spatial:index="0">
+ <spatial:boundaryMin spatial:spatialId="Xmin" spatial:value="0"/>
+ <spatial:boundaryMax spatial:spatialId="Xmax" spatial:value="1.65000001288718e-005"/>
+ </spatial:coordinateComponent>
+ <spatial:coordinateComponent spatial:spatialId="y" spatial:componentType="cartesianY" spatial:sbmlUnit="m" spatial:index="1">
+ <spatial:boundaryMin spatial:spatialId="Ymin" spatial:value="0"/>
+ <spatial:boundaryMax spatial:spatialId="Ymax" spatial:value="1.8300001102034e-005"/>
+ </spatial:coordinateComponent>
+ </spatial:listOfCoordinateComponents>
+ <spatial:listOfDomainTypes>
+ <spatial:domainType spatial:spatialId="background" spatial:spatialDimensions="3"/>
+ <spatial:domainType spatial:spatialId="roi_237" spatial:spatialDimensions="3"/>
+ <spatial:domainType spatial:spatialId="roi_255" spatial:spatialDimensions="3"/>
+ <spatial:domainType spatial:spatialId="background_roi_237_membrane" spatial:spatialDimensions="2"/>
+ <spatial:domainType spatial:spatialId="roi_237_roi_255_membrane" spatial:spatialDimensions="2"/>
+ </spatial:listOfDomainTypes>
+ <spatial:listOfDomains>
+ <spatial:domain spatial:spatialId="background0" spatial:domainType="background" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2371" spatial:domainType="roi_237" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="2.94642859444139e-007" spatial:coord2="2.95161308097323e-007" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2552" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="9.1339286427683e-006" spatial:coord2="5.90322616194645e-007" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2553" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="1.47321429722069e-006" spatial:coord2="1.47580654048661e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2554" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="9.1339286427683e-006" spatial:coord2="2.95161308097323e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2555" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="9.1339286427683e-006" spatial:coord2="5.01774223765448e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2556" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="1.17857143777655e-005" spatial:coord2="8.55967793482235e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2557" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="1.35535715344304e-005" spatial:coord2="8.55967793482235e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2558" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="8.83928578332416e-007" spatial:coord2="9.44516185911432e-006" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_2559" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="8.83928578332416e-007" spatial:coord2="1.15112910157956e-005" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_25510" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="8.83928578332416e-007" spatial:coord2="1.32822588643795e-005" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="roi_25511" spatial:domainType="roi_255" spatial:implicit="false">
+ <spatial:listOfInteriorPoints>
+ <spatial:interiorPoint spatial:coord1="1.17857143777655e-006" spatial:coord2="1.56435493291581e-005" spatial:coord3="4.49999987495175e-007"/>
+ </spatial:listOfInteriorPoints>
+ </spatial:domain>
+ <spatial:domain spatial:spatialId="membrane_background0_roi_2371" spatial:domainType="background_roi_237_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2552" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2553" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2554" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2555" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2556" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2557" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2558" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_2559" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_25510" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ <spatial:domain spatial:spatialId="membrane_roi_2371_roi_25511" spatial:domainType="roi_237_roi_255_membrane" spatial:implicit="false"/>
+ </spatial:listOfDomains>
+ <spatial:listOfAdjacentDomains>
+ <spatial:adjacentDomains spatial:spatialId="membrane_background0_roi_2371_roi_2371" spatial:domain1="membrane_background0_roi_2371" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_background0_roi_2371_background0" spatial:domain1="membrane_background0_roi_2371" spatial:domain2="background0"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2552_roi_2552" spatial:domain1="membrane_roi_2371_roi_2552" spatial:domain2="roi_2552"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2552_roi_2371" spatial:domain1="membrane_roi_2371_roi_2552" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2553_roi_2553" spatial:domain1="membrane_roi_2371_roi_2553" spatial:domain2="roi_2553"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2553_roi_2371" spatial:domain1="membrane_roi_2371_roi_2553" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2554_roi_2554" spatial:domain1="membrane_roi_2371_roi_2554" spatial:domain2="roi_2554"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2554_roi_2371" spatial:domain1="membrane_roi_2371_roi_2554" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2555_roi_2555" spatial:domain1="membrane_roi_2371_roi_2555" spatial:domain2="roi_2555"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2555_roi_2371" spatial:domain1="membrane_roi_2371_roi_2555" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2556_roi_2556" spatial:domain1="membrane_roi_2371_roi_2556" spatial:domain2="roi_2556"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2556_roi_2371" spatial:domain1="membrane_roi_2371_roi_2556" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2557_roi_2557" spatial:domain1="membrane_roi_2371_roi_2557" spatial:domain2="roi_2557"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2557_roi_2371" spatial:domain1="membrane_roi_2371_roi_2557" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2558_roi_2558" spatial:domain1="membrane_roi_2371_roi_2558" spatial:domain2="roi_2558"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2558_roi_2371" spatial:domain1="membrane_roi_2371_roi_2558" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2559_roi_2559" spatial:domain1="membrane_roi_2371_roi_2559" spatial:domain2="roi_2559"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_2559_roi_2371" spatial:domain1="membrane_roi_2371_roi_2559" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_25510_roi_25510" spatial:domain1="membrane_roi_2371_roi_25510" spatial:domain2="roi_25510"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_25510_roi_2371" spatial:domain1="membrane_roi_2371_roi_25510" spatial:domain2="roi_2371"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_25511_roi_25511" spatial:domain1="membrane_roi_2371_roi_25511" spatial:domain2="roi_25511"/>
+ <spatial:adjacentDomains spatial:spatialId="membrane_roi_2371_roi_25511_roi_2371" spatial:domain1="membrane_roi_2371_roi_25511" spatial:domain2="roi_2371"/>
+ </spatial:listOfAdjacentDomains>
+ <spatial:listOfGeometryDefinitions>
+ <spatial:sampledFieldGeometry spatial:spatialId="SegmentedImage_BioModel1_Application0_20120725_161513">
+ <spatial:listOfSampledVolumes>
+ <spatial:sampledVolume spatial:spatialId="background" spatial:domainType="background" spatial:sampledValue="0" spatial:minValue="0" spatial:maxValue="0"/>
+ <spatial:sampledVolume spatial:spatialId="roi_237" spatial:domainType="roi_237" spatial:sampledValue="1" spatial:minValue="0" spatial:maxValue="0"/>
+ <spatial:sampledVolume spatial:spatialId="roi_255" spatial:domainType="roi_255" spatial:sampledValue="2" spatial:minValue="0" spatial:maxValue="0"/>
+ </spatial:listOfSampledVolumes>
+ <spatial:sampledField spatial:spatialId="SegmentedImageSampledField" spatial:dataType="integer" spatial:interpolationType="constant" spatial:numSamples1="57" spatial:numSamples2="63" spatial:numSamples3="1">
+ <spatial:imageData spatial:dataType="uint8">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </spatial:imageData>
+ </spatial:sampledField>
+ </spatial:sampledFieldGeometry>
+ </spatial:listOfGeometryDefinitions>
+ </spatial:geometry>
+ </model>
+</sbml>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fbe...@us...> - 2013-11-28 17:07:23
|
Revision: 19304
http://sourceforge.net/p/sbml/code/19304
Author: fbergmann
Date: 2013-11-28 17:07:20 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
- added mexopts files that should work on OSX 10.8 and 10.9
Modified Paths:
--------------
trunk/libsbml/src/bindings/matlab/buildSBML.m
Added Paths:
-----------
trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh
trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh
Modified: trunk/libsbml/src/bindings/matlab/buildSBML.m
===================================================================
--- trunk/libsbml/src/bindings/matlab/buildSBML.m 2013-11-28 16:48:50 UTC (rev 19303)
+++ trunk/libsbml/src/bindings/matlab/buildSBML.m 2013-11-28 17:07:20 UTC (rev 19304)
@@ -643,7 +643,7 @@
disp(sprintf('* Creating mex files in %s', pwd));
% list the possible opts files to be tried
- optsfiles = {'', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
+ optsfiles = {'', './mexopts-osx109.sh', './mexopts-osx108.sh', './mexopts-lion.sh', './mexopts-xcode43.sh', './mexopts-xcode45.sh', './mexopts-R2009-R2010.sh', './mexopts-R2008.sh', './mexopts-R2007.sh'};
success = 0;
n = 1;
Added: trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh
===================================================================
--- trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh (rev 0)
+++ trunk/libsbml/src/bindings/matlab/mexopts-osx108.sh 2013-11-28 17:07:20 UTC (rev 19304)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.8'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
Added: trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh
===================================================================
--- trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh (rev 0)
+++ trunk/libsbml/src/bindings/matlab/mexopts-osx109.sh 2013-11-28 17:07:20 UTC (rev 19304)
@@ -0,0 +1,326 @@
+#
+# mexopts.sh Shell script for configuring MEX-file creation script,
+# mex. These options were tested with the specified compiler.
+#
+# usage: Do not call this file directly; it is sourced by the
+# mex shell script. Modify only if you don't like the
+# defaults after running mex. No spaces are allowed
+# around the '=' in the variable assignment.
+#
+# Note: For the version of system compiler supported with this release,
+# refer to the Supported and Compatible Compiler List at:
+# http://www.mathworks.com/support/compilers/current_release/
+#
+#
+# SELECTION_TAGs occur in template option files and are used by MATLAB
+# tools, such as mex and mbuild, to determine the purpose of the contents
+# of an option file. These tags are only interpreted when preceded by '#'
+# and followed by ':'.
+#
+#SELECTION_TAG_MEX_OPT: Template Options file for building MEX-files via the system ANSI compiler
+#
+# Copyright 1984-2008 The MathWorks, Inc.
+# $Revision: 1.78.4.16 $ $Date: 2008/11/04 19:40:11 $
+#----------------------------------------------------------------------------
+#
+ TMW_ROOT="$MATLAB"
+ MFLAGS=''
+ if [ "$ENTRYPOINT" = "mexLibrary" ]; then
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
+ else
+ MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
+ fi
+ case "$Arch" in
+ Undetermined)
+#----------------------------------------------------------------------------
+# Change this line if you need to specify the location of the MATLAB
+# root directory. The script needs to know where to find utility
+# routines so that it can determine the architecture; therefore, this
+# assignment needs to be done while the architecture is still
+# undetermined.
+#----------------------------------------------------------------------------
+ MATLAB="$MATLAB"
+ ;;
+ glnx86)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fPIC -pthread -m32"
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
+ CXXFLAGS="$CXXFLAGS -fPIC -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexglx'
+ LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ glnxa64)
+#----------------------------------------------------------------------------
+ RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ CFLAGS='-ansi -D_GNU_SOURCE'
+ CFLAGS="$CFLAGS -fexceptions"
+ CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CLIBS="$RPATH $MLIBS -lm"
+ COPTIMFLAGS='-O -DNDEBUG'
+ CDEBUGFLAGS='-g'
+ CLIBS="$CLIBS -lstdc++"
+#
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='g++'
+ CXXFLAGS='-ansi -D_GNU_SOURCE'
+ CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
+ CXXLIBS="$RPATH $MLIBS -lm"
+ CXXOPTIMFLAGS='-O -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: g95
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+#
+ FC='g95'
+ FFLAGS='-fexceptions'
+ FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
+ FLIBS="$RPATH $MLIBS -lm"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexa64'
+ LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ sol64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: Sun Studio
+ # CkeyManufacturer: Sun
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='cc -xarch=v9a'
+ CFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -mt'
+ CFLAGS="$CFLAGS -KPIC"
+ CLIBS="$MLIBS -lm"
+ CLIBS="$CLIBS -lc"
+ COPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CDEBUGFLAGS='-xs -g'
+#
+ # C++keyName: Sun Studio
+ # C++keyManufacturer: Sun
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX='CC -xarch=v9a -compat=5'
+ CCV=`CC -xarch=v9a -V 2>&1`
+ version=`expr "$CCV" : '.*\([0-9][0-9]*\)\.'`
+ if [ "$version" = "4" ]; then
+ echo "SC5.0 or later C++ compiler is required"
+ fi
+ CXXFLAGS='-dalign -xlibmieee -D__EXTENSIONS__ -library=stlport4,Crun'
+ CXXFLAGS="$CXXFLAGS -D_POSIX_C_SOURCE=199506L -mt"
+ CXXFLAGS="$CXXFLAGS -KPIC -norunpath"
+ CXXLIBS="$MLIBS -lm"
+ CXXOPTIMFLAGS='-xO3 -xlibmil -DNDEBUG'
+ CXXDEBUGFLAGS='-xs -g'
+#
+ # FortrankeyName: Sun Studio
+ # FortrankeyManufacturer: Sun
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='f90 -xarch=v9a'
+ FFLAGS='-dalign -f77=backslash'
+ FFLAGS="$FFLAGS -KPIC -mt"
+ FLIBS="$MLIBS -lfui -lfsu -lsunmath -lm -lc"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-xs -g'
+#
+ LD="$COMPILER"
+ LDEXTENSION='.mexs64'
+ LDFLAGS="-G -mt -M$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-xs -g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ mac)
+#----------------------------------------------------------------------------
+echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
+#----------------------------------------------------------------------------
+ ;;
+ maci)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='i386'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-gdwarf-2'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ maci64)
+#----------------------------------------------------------------------------
+ # StorageVersion: 1.0
+ # CkeyName: GNU C
+ # CkeyManufacturer: GNU
+ # CkeyLanguage: C
+ # CkeyVersion:
+ CC='gcc'
+ SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
+ MACOSX_DEPLOYMENT_TARGET='10.9'
+ ARCHS='x86_64'
+ CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CFLAGS="$CFLAGS -fexceptions"
+ CLIBS="$MLIBS"
+ COPTIMFLAGS='-O2 -DNDEBUG'
+ CDEBUGFLAGS='-g'
+#
+ CLIBS="$CLIBS -lstdc++"
+ # C++keyName: GNU C++
+ # C++keyManufacturer: GNU
+ # C++keyLanguage: C++
+ # C++keyVersion:
+ CXX=g++
+ CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ CXXLIBS="$MLIBS -lstdc++"
+ CXXOPTIMFLAGS='-O2 -DNDEBUG'
+ CXXDEBUGFLAGS='-g'
+#
+ # FortrankeyName: GNU Fortran
+ # FortrankeyManufacturer: GNU
+ # FortrankeyLanguage: Fortran
+ # FortrankeyVersion:
+ FC='gfortran'
+ FFLAGS='-fexceptions -m64 -fbackslash'
+ FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
+ FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
+ FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
+ FOPTIMFLAGS='-O'
+ FDEBUGFLAGS='-g'
+#
+ LD="$CC"
+ LDEXTENSION='.mexmaci64'
+ LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+ LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
+ LDOPTIMFLAGS='-O'
+ LDDEBUGFLAGS='-g'
+#
+ POSTLINK_CMDS=':'
+#----------------------------------------------------------------------------
+ ;;
+ esac
+#############################################################################
+#
+# Architecture independent lines:
+#
+# Set and uncomment any lines which will apply to all architectures.
+#
+#----------------------------------------------------------------------------
+# CC="$CC"
+# CFLAGS="$CFLAGS"
+# COPTIMFLAGS="$COPTIMFLAGS"
+# CDEBUGFLAGS="$CDEBUGFLAGS"
+# CLIBS="$CLIBS"
+#
+# FC="$FC"
+# FFLAGS="$FFLAGS"
+# FOPTIMFLAGS="$FOPTIMFLAGS"
+# FDEBUGFLAGS="$FDEBUGFLAGS"
+# FLIBS="$FLIBS"
+#
+# LD="$LD"
+# LDFLAGS="$LDFLAGS"
+# LDOPTIMFLAGS="$LDOPTIMFLAGS"
+# LDDEBUGFLAGS="$LDDEBUGFLAGS"
+#----------------------------------------------------------------------------
+#############################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fbe...@us...> - 2013-11-28 16:48:53
|
Revision: 19303
http://sourceforge.net/p/sbml/code/19303
Author: fbergmann
Date: 2013-11-28 16:48:50 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
- allow to configure with ruby on OS X mavericks
Modified Paths:
--------------
trunk/libsbml/config/ruby.m4
trunk/libsbml/configure
Modified: trunk/libsbml/config/ruby.m4
===================================================================
--- trunk/libsbml/config/ruby.m4 2013-11-28 16:32:51 UTC (rev 19302)
+++ trunk/libsbml/config/ruby.m4 2013-11-28 16:48:50 UTC (rev 19303)
@@ -76,14 +76,20 @@
RUBY_PREFIX=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['prefix']"]`
AC_MSG_RESULT($RUBY_PREFIX)
- if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""]` = "OK";
then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
+ RUBY_H=`$RUBY -rrbconfig -e ["include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
+ else
+ if test `$RUBY -rrbconfig -e ["puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""]` = "OK";
+ then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "]`
RUBY_H=`$RUBY -rrbconfig -e ["include Config; print \"#{CONFIG['rubyhdrdir']}\" "]`"/ruby.h"
else
RUBY_ARCHDIR=`$RUBY -rrbconfig -e ["include Config; puts CONFIG['archdir']"]`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
- fi
+ fi
+ fi
AC_MSG_CHECKING(for ruby.h)
if test -z "$RUBY_H" || ! test -f "$RUBY_H";
Modified: trunk/libsbml/configure
===================================================================
--- trunk/libsbml/configure 2013-11-28 16:32:51 UTC (rev 19302)
+++ trunk/libsbml/configure 2013-11-28 16:48:50 UTC (rev 19303)
@@ -7188,6 +7188,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_PREFIX" >&5
$as_echo "$RUBY_PREFIX" >&6; }
+ if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"2.0.0\" ? \"OK\" : \"OLD\""` = "OK";
+ then
+ RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
+ RUBY_H=`$RUBY -rrbconfig -e "include RbConfig; print \"#{CONFIG['rubyhdrdir']}\" "`"/ruby.h"
+ else
if test `$RUBY -rrbconfig -e "puts RUBY_VERSION >= \"1.9.0\" ? \"OK\" : \"OLD\""` = "OK";
then
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; print \"#{CONFIG['rubyhdrdir']} -I#{CONFIG['rubyhdrdir']}/#{CONFIG['arch']}\" "`
@@ -7196,6 +7201,7 @@
RUBY_ARCHDIR=`$RUBY -rrbconfig -e "include Config; puts CONFIG['archdir']"`
RUBY_H="${RUBY_ARCHDIR}/ruby.h"
fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby.h" >&5
$as_echo_n "checking for ruby.h... " >&6; }
@@ -9740,7 +9746,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 9743 "configure"' > conftest.$ac_ext
+ echo '#line 9749 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -11958,11 +11964,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11961: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11967: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11965: \$? = $ac_status" >&5
+ echo "$as_me:11971: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12248,11 +12254,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12251: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12257: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12255: \$? = $ac_status" >&5
+ echo "$as_me:12261: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12352,11 +12358,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12355: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12361: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12359: \$? = $ac_status" >&5
+ echo "$as_me:12365: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14377,7 +14383,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14380 "configure"
+#line 14386 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14477,7 +14483,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14480 "configure"
+#line 14486 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16822,11 +16828,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16825: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16831: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16829: \$? = $ac_status" >&5
+ echo "$as_me:16835: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16926,11 +16932,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16929: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16935: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16933: \$? = $ac_status" >&5
+ echo "$as_me:16939: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18509,11 +18515,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18512: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18518: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18516: \$? = $ac_status" >&5
+ echo "$as_me:18522: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -18613,11 +18619,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18616: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18622: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18620: \$? = $ac_status" >&5
+ echo "$as_me:18626: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20783,11 +20789,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:20786: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:20792: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:20790: \$? = $ac_status" >&5
+ echo "$as_me:20796: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21073,11 +21079,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21076: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21082: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21080: \$? = $ac_status" >&5
+ echo "$as_me:21086: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21177,11 +21183,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21180: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21186: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21184: \$? = $ac_status" >&5
+ echo "$as_me:21190: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 16:32:54
|
Revision: 19302
http://sourceforge.net/p/sbml/code/19302
Author: sarahkeating
Date: 2013-11-28 16:32:51 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
Merged revision(s) 19254-19301 from trunk/libsbml:
Modified Paths:
--------------
branches/libsbml-experimental/CMakeLists.txt
branches/libsbml-experimental/NEWS.txt
branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.cpp
branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.h
branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.cpp
branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.h
branches/libsbml-experimental/src/sbml/packages/comp/util/test/TestURIResolvers.cpp
Added Paths:
-----------
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestDeletion.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestModelDefinition.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedBy.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedElement.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSBaseRef.c
branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSubmodel.c
Property Changed:
----------------
branches/libsbml-experimental/
Index: branches/libsbml-experimental
===================================================================
--- branches/libsbml-experimental 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental 2013-11-28 16:32:51 UTC (rev 19302)
Property changes on: branches/libsbml-experimental
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/L3Parser:15528-15625,15656-15673
/branches/libsbml-4:9056-10118
/branches/libsbml-5-conversion:14155-14227
-/trunk/libsbml:18168-18171,18174-18194,18196-18201,18204,18207-18209,18211-18213,18215-18216,18226,18228-18292,18294-18388,18390-18443,18450-18454,18456-18458,18460-18462,18464,18466,18469-18520,18523-18561,18563,18565-18584,18586-18638,18640-18641,18644-18715,18717-18844,18846-19128,19130-19253
+/trunk/libsbml:18168-18171,18174-18194,18196-18201,18204,18207-18209,18211-18213,18215-18216,18226,18228-18292,18294-18388,18390-18443,18450-18454,18456-18458,18460-18462,18464,18466,18469-18520,18523-18561,18563,18565-18584,18586-18638,18640-18641,18644-18715,18717-18844,18846-19128,19130-19301
\ No newline at end of property
Modified: branches/libsbml-experimental/CMakeLists.txt
===================================================================
--- branches/libsbml-experimental/CMakeLists.txt 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/CMakeLists.txt 2013-11-28 16:32:51 UTC (rev 19302)
@@ -288,6 +288,7 @@
find_path(LIBEXPAT_INCLUDE_DIR
NAMES expat.h
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the Expat include files."
)
@@ -321,6 +322,7 @@
NAMES libxml/parser.h
PATHS /usr/include /usr/local/include
/usr/include/libxml2
+ ${CMAKE_OSX_SYSROOT}/usr/include/libxml2
/usr/local/include/libxml2
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the libxml2 include files."
@@ -356,6 +358,7 @@
find_path(XERCES_INCLUDE_DIR
NAMES xercesc/parsers/XercesDOMParser.hpp
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include/xercesc
/usr/include/xercesc
/usr/local/include/xercesc
${LIBSBML_DEPENDENCY_DIR}/include
@@ -382,6 +385,7 @@
find_library(LIBBZ_LIBRARY
NAMES bzip2.lib bz2 libbz2.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the bzip2 library."
)
@@ -398,10 +402,21 @@
find_path(LIBBZ_INCLUDE_DIR
NAMES bzlib.h bzip2/bzlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the bzip2 include files."
)
+ if (NOT LIBBZ_INCLUDE_DIR)
+ find_path(LIBBZ_INCLUDE_DIR
+ NAMES bzlib.h bzip2/bzlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the bzip2 include files."
+ )
+ endif()
set(USE_BZ2 ON)
add_definitions( -DUSE_BZ2 )
@@ -442,6 +457,7 @@
find_library(LIBZ_LIBRARY
NAMES zdll.lib z zlib.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the zip compression library."
)
@@ -458,10 +474,21 @@
find_path(LIBZ_INCLUDE_DIR
NAMES zlib.h zlib/zlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the zlib include files."
)
+ if (NOT LIBZ_INCLUDE_DIR)
+ find_path(LIBZ_INCLUDE_DIR
+ NAMES zlib.h zlib/zlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the zlib include files."
+ )
+ endif()
set(USE_ZLIB ON)
add_definitions( -DUSE_ZLIB )
@@ -704,6 +731,7 @@
find_library(LIBICONV_LIBRARY
NAMES libiconv.lib iconv.lib iconv
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the libiconv library."
)
Modified: branches/libsbml-experimental/NEWS.txt
===================================================================
--- branches/libsbml-experimental/NEWS.txt 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/NEWS.txt 2013-11-28 16:32:51 UTC (rev 19302)
@@ -1,6 +1,80 @@
libSBML NEWS -- History of user-visible changes
+====================================================================
+Next release ...
+====================================================================
+STABLE RELEASE
+
+* New features
+
+ - 'comp' package-specific updates:
+
+ - 'fbc' package-specific updates:
+
+ - 'layout' package-specific updates:
+
+ - 'qual' package-specific updates:
+
+* Bug fixes
+
+ - The Borland compiler does not handle implicit casts and
+ unfortunately there was one such cast in the new code introduced
+ for 5.9.0. This has now been fixed. Thanks to Totte Karlsson for
+ reporting it.
+
+ - A memory leak in SBasePluiginCreator has been plugged. Thanks to
+ Andy Somogyi for reporting it.
+
+ - 'comp' package-specific updates:
+
+ - 'fbc' package-specific updates:
+
+ - The CobraToFbcConverter was losing the charge and the
+ capitalization of the formula when parsing the notes element.
+ This has been fixed.
+
+ - 'layout' package-specific updates:
+
+ - 'qual' package-specific updates:
+
+* Configuration/build system changes
+
+
+* Miscellaneous
+
+
+EXPERIMENTAL RELEASE
+
+* New features
+
+ - 'distrib' package-specific updates:
+
+ - 'groups' package-specific updates:
+
+ - 'multi' package-specific updates:
+
+ - 'render' package-specific updates:
+
+ - 'req' package-specific updates:
+
+ - 'spatial' package-specific updates:
+
+* Bug fixes
+
+ - 'distrib' package-specific updates:
+
+ - 'groups' package-specific updates:
+
+ - 'multi' package-specific updates:
+
+ - 'render' package-specific updates:
+
+ - 'req' package-specific updates:
+
+ - 'spatial' package-specific updates:
+
+
====================================================================
Version 5.9.0 (2013-11-14)
====================================================================
Modified: branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-28 16:32:51 UTC (rev 19302)
@@ -195,5 +195,41 @@
}
/** @endcond */
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion)
+{
+ return new ModelDefinition(level, version, pkgVersion);
+}
+
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ delete md;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ {
+ return static_cast<ModelDefinition_t*>(md->clone());
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.h
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-28 16:32:51 UTC (rev 19302)
@@ -196,7 +196,23 @@
//
// C API will be added here.
//
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion);
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * emd);
+
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * emd);
+
+
+
+
END_C_DECLS
LIBSBML_CPP_NAMESPACE_END
Modified: branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-28 16:32:51 UTC (rev 19302)
@@ -1438,6 +1438,20 @@
*/
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s)
+{
+ if (s == NULL)
+ return NULL;
+
+ return s->getSubstanceConversionFactor().empty() ? NULL : safe_strdup(s->getSubstanceConversionFactor().c_str());
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s)
{
if (s == NULL)
@@ -1499,6 +1513,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? static_cast<int>(s->isSetSubstanceConversionFactor()) : 0;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? static_cast<int>(s->isSetTimeConversionFactor()) : 0;
@@ -1554,6 +1579,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor)
+{
+ return (s != NULL) ? s->setSubstanceConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor)
{
return (s != NULL) ? s->setTimeConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
@@ -1609,6 +1645,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? s->unsetSubstanceConversionFactor() : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? s->unsetTimeConversionFactor() : LIBSBML_INVALID_OBJECT;
Modified: branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.h
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.h 2013-11-28 15:01:44 UTC (rev 19301)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/Submodel.h 2013-11-28 16:32:51 UTC (rev 19302)
@@ -879,6 +879,11 @@
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s);
@@ -904,6 +909,11 @@
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s);
@@ -929,6 +939,11 @@
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor);
+
+
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor);
@@ -954,6 +969,11 @@
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s);
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestDeletion.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestDeletion.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestDeletion.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,191 @@
+/**
+ * \file TestDeletion.c
+ * \brief Deletion unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/Deletion.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static Deletion_t *P;
+
+
+void
+DeletionTest_setup (void)
+{
+ P = Deletion_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("Deletion_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+DeletionTest_teardown (void)
+{
+ Deletion_free(P);
+}
+
+
+START_TEST (test_comp_deletion_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_DELETION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( Deletion_getId (P) == NULL );
+ fail_unless( Deletion_getName (P) == NULL );
+
+ fail_unless( !Deletion_isSetId (P) );
+ fail_unless( !Deletion_isSetName (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_free_NULL)
+{
+ Deletion_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ Deletion_setId(P, id);
+
+ fail_unless( !strcmp(Deletion_getId(P), id) );
+ fail_unless( Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) == id)
+ {
+ fail("Deletion_setId(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetId(P);
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) != NULL)
+ {
+ fail("Deletion_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ Deletion_setName(P, name);
+
+ fail_unless( !strcmp(Deletion_getName(P), name) );
+ fail_unless( Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) == name)
+ {
+ fail("Deletion_setName(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetName(P);
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) != NULL)
+ {
+ fail("Deletion_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_hasRequiredAttributes )
+{
+ Deletion_t *P = Deletion_create (3, 1, 1);
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ Deletion_setId(P, "p");
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( Deletion_hasRequiredAttributes(P));
+
+ Deletion_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_Deletion (void)
+{
+ Suite *suite = suite_create("comp_deletion");
+ TCase *tcase = tcase_create("comp_deletion");
+
+
+ tcase_add_checked_fixture( tcase,
+ DeletionTest_setup,
+ DeletionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_deletion_create );
+ tcase_add_test( tcase, test_comp_deletion_free_NULL );
+ tcase_add_test( tcase, test_comp_deletion_id );
+ tcase_add_test( tcase, test_comp_deletion_name );
+ tcase_add_test( tcase, test_comp_deletion_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,255 @@
+/**
+ * \file TestExternalModelDefinition.c
+ * \brief ExternalModelDefinition unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ExternalModelDefinition.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ExternalModelDefinition_t *P;
+
+
+void
+ExternalModelDefinitionTest_setup (void)
+{
+ P = ExternalModelDefinition_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ExternalModelDefinition_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ExternalModelDefinitionTest_teardown (void)
+{
+ ExternalModelDefinition_free(P);
+}
+
+
+START_TEST (test_comp_externalModelDefinition_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_EXTERNALMODELDEFINITION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ExternalModelDefinition_getId (P) == NULL );
+ fail_unless( ExternalModelDefinition_getName (P) == NULL );
+ fail_unless( ExternalModelDefinition_getModelRef (P) == NULL );
+ fail_unless( ExternalModelDefinition_getSource (P) == NULL );
+
+ fail_unless( !ExternalModelDefinition_isSetId (P) );
+ fail_unless( !ExternalModelDefinition_isSetName (P) );
+ fail_unless( !ExternalModelDefinition_isSetModelRef (P) );
+ fail_unless( !ExternalModelDefinition_isSetSource (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_free_NULL)
+{
+ ExternalModelDefinition_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ ExternalModelDefinition_setId(P, id);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getId(P), id) );
+ fail_unless( ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_getId(P) == id)
+ {
+ fail("ExternalModelDefinition_setId(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetId(P);
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_getId(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetName(P) );
+
+ ExternalModelDefinition_setName(P, name);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getName(P), name) );
+ fail_unless( ExternalModelDefinition_isSetName(P) );
+
+ if (ExternalModelDefinition_getName(P) == name)
+ {
+ fail("ExternalModelDefinition_setName(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetName(P);
+
+ fail_unless( !ExternalModelDefinition_isSetName(P) );
+
+ if (ExternalModelDefinition_getName(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_modelRef)
+{
+ const char *modelRef = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetModelRef(P) );
+
+ ExternalModelDefinition_setModelRef(P, modelRef);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getModelRef(P), modelRef) );
+ fail_unless( ExternalModelDefinition_isSetModelRef(P) );
+
+ if (ExternalModelDefinition_getModelRef(P) == modelRef)
+ {
+ fail("ExternalModelDefinition_setModelRef(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetModelRef(P);
+
+ fail_unless( !ExternalModelDefinition_isSetModelRef(P) );
+
+ if (ExternalModelDefinition_getModelRef(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetModelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_source)
+{
+ const char *source = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetSource(P) );
+
+ ExternalModelDefinition_setSource(P, source);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getSource(P), source) );
+ fail_unless( ExternalModelDefinition_isSetSource(P) );
+
+ if (ExternalModelDefinition_getSource(P) == source)
+ {
+ fail("ExternalModelDefinition_setSource(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetSource(P);
+
+ fail_unless( !ExternalModelDefinition_isSetSource(P) );
+
+ if (ExternalModelDefinition_getSource(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetSource(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_hasRequiredAttributes )
+{
+ ExternalModelDefinition_t *P = ExternalModelDefinition_create (3, 1, 1);
+
+ fail_unless ( !ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_setId(P, "p");
+
+ fail_unless ( !ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_setSource(P, "http://here.com/it/is");
+
+ fail_unless ( ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ExternalModelDefinition (void)
+{
+ Suite *suite = suite_create("comp_externalModelDefinition");
+ TCase *tcase = tcase_create("comp_externalModelDefinition");
+
+
+ tcase_add_checked_fixture( tcase,
+ ExternalModelDefinitionTest_setup,
+ ExternalModelDefinitionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_externalModelDefinition_create );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_free_NULL );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_id );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_name );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_modelRef );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_source );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestModelDefinition.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestModelDefinition.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestModelDefinition.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestModelDefinition.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,166 @@
+/**
+ * \file TestModelDefinition.c
+ * \brief ModelDefinition unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ModelDefinition.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ModelDefinition_t *P;
+
+
+void
+ModelDefinitionTest_setup (void)
+{
+ P = ModelDefinition_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ModelDefinition_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ModelDefinitionTest_teardown (void)
+{
+ ModelDefinition_free(P);
+}
+
+
+START_TEST (test_comp_modelDefinition_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_MODELDEFINITION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_free_NULL)
+{
+ ModelDefinition_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Model_isSetId(P) );
+
+ Model_setId(P, id);
+
+ fail_unless( !strcmp(Model_getId(P), id) );
+ fail_unless( Model_isSetId(P) );
+
+ if (Model_getId(P) == id)
+ {
+ fail("Model_setId(...) did not make a copy of string.");
+ }
+
+ Model_unsetId(P);
+
+ fail_unless( !Model_isSetId(P) );
+
+ if (Model_getId(P) != NULL)
+ {
+ fail("Model_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Model_isSetName(P) );
+
+ Model_setName(P, name);
+
+ fail_unless( !strcmp(Model_getName(P), name) );
+ fail_unless( Model_isSetName(P) );
+
+ if (Model_getName(P) == name)
+ {
+ fail("Model_setName(...) did not make a copy of string.");
+ }
+
+ Model_unsetName(P);
+
+ fail_unless( !Model_isSetName(P) );
+
+ if (Model_getName(P) != NULL)
+ {
+ fail("Model_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ModelDefinition (void)
+{
+ Suite *suite = suite_create("comp_modelDefinition");
+ TCase *tcase = tcase_create("comp_modelDefinition");
+
+
+ tcase_add_checked_fixture( tcase,
+ ModelDefinitionTest_setup,
+ ModelDefinitionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_modelDefinition_create );
+ tcase_add_test( tcase, test_comp_modelDefinition_free_NULL );
+ tcase_add_test( tcase, test_comp_modelDefinition_id );
+ tcase_add_test( tcase, test_comp_modelDefinition_name );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedBy.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedBy.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedBy.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedBy.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,159 @@
+/**
+ * \file TestReplacedBy.c
+ * \brief ReplacedBy unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ReplacedBy.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ReplacedBy_t *P;
+
+
+void
+ReplacedByTest_setup (void)
+{
+ P = ReplacedBy_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ReplacedBy_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ReplacedByTest_teardown (void)
+{
+ ReplacedBy_free(P);
+}
+
+
+START_TEST (test_comp_replacedBy_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_REPLACEDBY );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ReplacedBy_getSubmodelRef (P) == NULL );
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_free_NULL)
+{
+ ReplacedBy_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_submodelRef)
+{
+ const char *submodelRef = "mitochondria";
+
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef(P) );
+
+ ReplacedBy_setSubmodelRef(P, submodelRef);
+
+ fail_unless( !strcmp(ReplacedBy_getSubmodelRef(P), submodelRef) );
+ fail_unless( ReplacedBy_isSetSubmodelRef(P) );
+
+ if (ReplacedBy_getSubmodelRef(P) == submodelRef)
+ {
+ fail("ReplacedBy_setSubmodelRef(...) submodelRef not make a copy of string.");
+ }
+
+ ReplacedBy_unsetSubmodelRef(P);
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef(P) );
+
+ if (ReplacedBy_getSubmodelRef(P) != NULL)
+ {
+ fail("ReplacedBy_unsetSubmodelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_hasRequiredAttributes )
+{
+ ReplacedBy_t *P = ReplacedBy_create (3, 1, 1);
+
+ fail_unless ( !ReplacedBy_hasRequiredAttributes(P));
+
+ ReplacedBy_setSubmodelRef(P, "p");
+
+ fail_unless ( !ReplacedBy_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( ReplacedBy_hasRequiredAttributes(P));
+
+ ReplacedBy_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ReplacedBy (void)
+{
+ Suite *suite = suite_create("comp_replacedBy");
+ TCase *tcase = tcase_create("comp_replacedBy");
+
+
+ tcase_add_checked_fixture( tcase,
+ ReplacedByTest_setup,
+ ReplacedByTest_teardown );
+
+ tcase_add_test( tcase, test_comp_replacedBy_create );
+ tcase_add_test( tcase, test_comp_replacedBy_free_NULL );
+ tcase_add_test( tcase, test_comp_replacedBy_submodelRef );
+ tcase_add_test( tcase, test_comp_replacedBy_hasRequiredAttributes);
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedElement.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedElement.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedElement.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestReplacedElement.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,223 @@
+/**
+ * \file TestReplacedElement.c
+ * \brief ReplacedElement unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ReplacedElement.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ReplacedElement_t *P;
+
+
+void
+ReplacedElementTest_setup (void)
+{
+ P = ReplacedElement_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ReplacedElement_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ReplacedElementTest_teardown (void)
+{
+ ReplacedElement_free(P);
+}
+
+
+START_TEST (test_comp_replacedElement_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_REPLACEDELEMENT );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ReplacedElement_getSubmodelRef (P) == NULL );
+ fail_unless( ReplacedElement_getDeletion (P) == NULL );
+ fail_unless( ReplacedElement_getConversionFactor (P) == NULL );
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef (P) );
+ fail_unless( !ReplacedElement_isSetDeletion (P) );
+ fail_unless( !ReplacedElement_isSetConversionFactor (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_free_NULL)
+{
+ ReplacedElement_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_submodelRef)
+{
+ const char *submodelRef = "mitochondria";
+
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef(P) );
+
+ ReplacedElement_setSubmodelRef(P, submodelRef);
+
+ fail_unless( !strcmp(ReplacedElement_getSubmodelRef(P), submodelRef) );
+ fail_unless( ReplacedElement_isSetSubmodelRef(P) );
+
+ if (ReplacedElement_getSubmodelRef(P) == submodelRef)
+ {
+ fail("ReplacedElement_setSubmodelRef(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetSubmodelRef(P);
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef(P) );
+
+ if (ReplacedElement_getSubmodelRef(P) != NULL)
+ {
+ fail("ReplacedElement_unsetSubmodelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_deletion)
+{
+ const char *deletion = "My_Favorite_Factory";
+
+
+ fail_unless( !ReplacedElement_isSetDeletion(P) );
+
+ ReplacedElement_setDeletion(P, deletion);
+
+ fail_unless( !strcmp(ReplacedElement_getDeletion(P), deletion) );
+ fail_unless( ReplacedElement_isSetDeletion(P) );
+
+ if (ReplacedElement_getDeletion(P) == deletion)
+ {
+ fail("ReplacedElement_setDeletion(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetDeletion(P);
+
+ fail_unless( !ReplacedElement_isSetDeletion(P) );
+
+ if (ReplacedElement_getDeletion(P) != NULL)
+ {
+ fail("ReplacedElement_unsetDeletion(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_conversionFactor)
+{
+ const char *conversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !ReplacedElement_isSetConversionFactor(P) );
+
+ ReplacedElement_setConversionFactor(P, conversionFactor);
+
+ fail_unless( !strcmp(ReplacedElement_getConversionFactor(P), conversionFactor) );
+ fail_unless( ReplacedElement_isSetConversionFactor(P) );
+
+ if (ReplacedElement_getConversionFactor(P) == conversionFactor)
+ {
+ fail("ReplacedElement_setConversionFactor(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetConversionFactor(P);
+
+ fail_unless( !ReplacedElement_isSetConversionFactor(P) );
+
+ if (ReplacedElement_getConversionFactor(P) != NULL)
+ {
+ fail("ReplacedElement_unsetConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_hasRequiredAttributes )
+{
+ ReplacedElement_t *P = ReplacedElement_create (3, 1, 1);
+
+ fail_unless ( !ReplacedElement_hasRequiredAttributes(P));
+
+ ReplacedElement_setSubmodelRef(P, "p");
+
+ fail_unless ( !ReplacedElement_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( ReplacedElement_hasRequiredAttributes(P));
+
+ ReplacedElement_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ReplacedElement (void)
+{
+ Suite *suite = suite_create("comp_replacedElement");
+ TCase *tcase = tcase_create("comp_replacedElement");
+
+
+ tcase_add_checked_fixture( tcase,
+ ReplacedElementTest_setup,
+ ReplacedElementTest_teardown );
+
+ tcase_add_test( tcase, test_comp_replacedElement_create );
+ tcase_add_test( tcase, test_comp_replacedElement_free_NULL );
+ tcase_add_test( tcase, test_comp_replacedElement_submodelRef );
+ tcase_add_test( tcase, test_comp_replacedElement_deletion );
+ tcase_add_test( tcase, test_comp_replacedElement_conversionFactor );
+ tcase_add_test( tcase, test_comp_replacedElement_hasRequiredAttributes);
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSBaseRef.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSBaseRef.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSBaseRef.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSBaseRef.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,299 @@
+/**
+ * \file TestSBaseRef.c
+ * \brief SBaseRef unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/SBaseRef.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static SBaseRef_t *P;
+
+
+void
+SBaseRefTest_setup (void)
+{
+ P = SBaseRef_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("SBaseRef_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+SBaseRefTest_teardown (void)
+{
+ SBaseRef_free(P);
+}
+
+
+START_TEST (test_comp_sBaseRef_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_SBASEREF );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( SBaseRef_getIdRef (P) == NULL );
+ fail_unless( SBaseRef_getUnitRef (P) == NULL );
+ fail_unless( SBaseRef_getMetaIdRef (P) == NULL );
+ fail_unless( SBaseRef_getPortRef (P) == NULL );
+ fail_unless( SBaseRef_getSBaseRef (P) == NULL );
+
+ fail_unless( !SBaseRef_isSetIdRef (P) );
+ fail_unless( !SBaseRef_isSetUnitRef (P) );
+ fail_unless( !SBaseRef_isSetMetaIdRef (P) );
+ fail_unless( !SBaseRef_isSetPortRef (P) );
+ fail_unless( !SBaseRef_isSetSBaseRef (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_free_NULL)
+{
+ SBaseRef_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_idRef)
+{
+ const char *idRef = "mitochondria";
+
+
+ fail_unless( !SBaseRef_isSetIdRef(P) );
+
+ SBaseRef_setIdRef(P, idRef);
+
+ fail_unless( !strcmp(SBaseRef_getIdRef(P), idRef) );
+ fail_unless( SBaseRef_isSetIdRef(P) );
+
+ if (SBaseRef_getIdRef(P) == idRef)
+ {
+ fail("SBaseRef_setIdRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetIdRef(P);
+
+ fail_unless( !SBaseRef_isSetIdRef(P) );
+
+ if (SBaseRef_getIdRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetIdRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_unitRef)
+{
+ const char *unitRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetUnitRef(P) );
+
+ SBaseRef_setUnitRef(P, unitRef);
+
+ fail_unless( !strcmp(SBaseRef_getUnitRef(P), unitRef) );
+ fail_unless( SBaseRef_isSetUnitRef(P) );
+
+ if (SBaseRef_getUnitRef(P) == unitRef)
+ {
+ fail("SBaseRef_setUnitRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetUnitRef(P);
+
+ fail_unless( !SBaseRef_isSetUnitRef(P) );
+
+ if (SBaseRef_getUnitRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetUnitRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_metaIdRef)
+{
+ const char *metaIdRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetMetaIdRef(P) );
+
+ SBaseRef_setMetaIdRef(P, metaIdRef);
+
+ fail_unless( !strcmp(SBaseRef_getMetaIdRef(P), metaIdRef) );
+ fail_unless( SBaseRef_isSetMetaIdRef(P) );
+
+ if (SBaseRef_getMetaIdRef(P) == metaIdRef)
+ {
+ fail("SBaseRef_setMetaIdRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetMetaIdRef(P);
+
+ fail_unless( !SBaseRef_isSetMetaIdRef(P) );
+
+ if (SBaseRef_getMetaIdRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetMetaIdRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_portRef)
+{
+ const char *portRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetPortRef(P) );
+
+ SBaseRef_setPortRef(P, portRef);
+
+ fail_unless( !strcmp(SBaseRef_getPortRef(P), portRef) );
+ fail_unless( SBaseRef_isSetPortRef(P) );
+
+ if (SBaseRef_getPortRef(P) == portRef)
+ {
+ fail("SBaseRef_setPortRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetPortRef(P);
+
+ fail_unless( !SBaseRef_isSetPortRef(P) );
+
+ if (SBaseRef_getPortRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetPortRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_sBaseRef)
+{
+ SBaseRef_t *sBaseRef = SBaseRef_create(3, 1, 1);
+
+ fail_unless( !SBaseRef_isSetSBaseRef(P) );
+
+ SBaseRef_setSBaseRef(P, sBaseRef);
+
+ fail_unless( SBaseRef_getSBaseRef(P) != NULL);
+ fail_unless( SBaseRef_isSetSBaseRef(P) );
+
+ if (SBaseRef_getSBaseRef(P) == sBaseRef)
+ {
+ fail("SBaseRef_setSBaseRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetSBaseRef(P);
+
+ fail_unless( !SBaseRef_isSetSBaseRef(P) );
+
+ if (SBaseRef_getSBaseRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetSBaseRef(P) did not clear string.");
+ }
+
+ SBaseRef_free(sBaseRef);
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_hasRequiredAttributes )
+{
+ SBaseRef_t *P = SBaseRef_create (3, 1, 1);
+
+ fail_unless ( !SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetIdRef(P);
+ SBaseRef_setMetaIdRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetMetaIdRef(P);
+ SBaseRef_setUnitRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetUnitRef(P);
+ SBaseRef_setPortRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_SBaseRef (void)
+{
+ Suite *suite = suite_create("comp_sBaseRef");
+ TCase *tcase = tcase_create("comp_sBaseRef");
+
+
+ tcase_add_checked_fixture( tcase,
+ SBaseRefTest_setup,
+ SBaseRefTest_teardown );
+
+ tcase_add_test( tcase, test_comp_sBaseRef_create );
+ tcase_add_test( tcase, test_comp_sBaseRef_free_NULL );
+ tcase_add_test( tcase, test_comp_sBaseRef_idRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_unitRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_metaIdRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_portRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_sBaseRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Copied: branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSubmodel.c (from rev 19301, trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSubmodel.c)
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSubmodel.c (rev 0)
+++ branches/libsbml-experimental/src/sbml/packages/comp/sbml/test/TestSubmodel.c 2013-11-28 16:32:51 UTC (rev 19302)
@@ -0,0 +1,359 @@
+/**
+ * \file TestSubmodel.c
+ * \brief Submodel unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/Submodel.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static Submodel_t *P;
+
+
+void
+SubmodelTest_setup (void)
+{
+ P = Submodel_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("Submodel_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+SubmodelTest_teardown (void)
+{
+ Submodel_free(P);
+}
+
+
+START_TEST (test_comp_submodel_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_SUBMODEL );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( Submodel_getId (P) == NULL );
+ fail_unless( Submodel_getName (P) == NULL );
+ fail_unless( Submodel_getModelRef (P) == NULL );
+ fail_unless( Submodel_getSubstanceConversionFactor (P) == NULL );
+ fail_unless( Submodel_getTimeConversionFactor (P) == NULL );
+ fail_unless( Submodel_getExtentConversionFactor (P) == NULL );
+ fail_unless( Submodel_getDeletion (P, 0) == NULL );
+
+ fail_unless( !Submodel_isSetId (P) );
+ fail_unless( !Submodel_isSetName (P) );
+ fail_unless( !Submodel_isSetModelRef (P) );
+ fail_unless( !Submodel_isSetSubstanceConversionFactor (P) );
+ fail_unless( !Submodel_isSetTimeConversionFactor (P) );
+ fail_unless( !Submodel_isSetExtentConversionFactor (P) );
+ fail_unless( !Submodel_getNumDeletions(P)==0 );
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_free_NULL)
+{
+ Submodel_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Submodel_isSetId(P) );
+
+ Submodel_setId(P, id);
+
+ fail_unless( !strcmp(Submodel_getId(P), id) );
+ fail_unless( Submodel_isSetId(P) );
+
+ if (Submodel_getId(P) == id)
+ {
+ fail("Submodel_setId(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetId(P);
+
+ fail_unless( !Submodel_isSetId(P) );
+
+ if (Submodel_getId(P) != NULL)
+ {
+ fail("Submodel_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetName(P) );
+
+ Submodel_setName(P, name);
+
+ fail_unless( !strcmp(Submodel_getName(P), name) );
+ fail_unless( Submodel_isSetName(P) );
+
+ if (Submodel_getName(P) == name)
+ {
+ fail("Submodel_setName(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetName(P);
+
+ fail_unless( !Submodel_isSetName(P) );
+
+ if (Submodel_getName(P) != NULL)
+ {
+ fail("Submodel_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_modelRef)
+{
+ const char *modelRef = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetModelRef(P) );
+
+ Submodel_setModelRef(P, modelRef);
+
+ fail_unless( !strcmp(Submodel_getModelRef(P), modelRef) );
+ fail_unless( Submodel_isSetModelRef(P) );
+
+ if (Submodel_getModelRef(P) == modelRef)
+ {
+ fail("Submodel_setModelRef(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetModelRef(P);
+
+ fail_unless( !Submodel_isSetModelRef(P) );
+
+ if (Submodel_getModelRef(P) != NULL)
+ {
+ fail("Submodel_unsetModelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_substanceConversionFactor)
+{
+ const char *substanceConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetSubstanceConversionFactor(P) );
+
+ Submodel_setSubstanceConversionFactor(P, substanceConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getSubstanceConversionFactor(P), substanceConversionFactor) );
+ fail_unless( Submodel_isSetSubstanceConversionFactor(P) );
+
+ if (Submodel_getSubstanceConversionFactor(P) == substanceConversionFactor)
+ {
+ fail("Submodel_setSubstanceConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetSubstanceConversionFactor(P);
+
+ fail_unless( !Submodel_isSetSubstanceConversionFactor(P) );
+
+ if (Submodel_getSubstanceConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetSubstanceConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_timeConversionFactor)
+{
+ const char *timeConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetTimeConversionFactor(P) );
+
+ Submodel_setTimeConversionFactor(P, timeConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getTimeConversionFactor(P), timeConversionFactor) );
+ fail_unless( Submodel_isSetTimeConversionFactor(P) );
+
+ if (Submodel_getTimeConversionFactor(P) == timeConversionFactor)
+ {
+ fail("Submodel_setTimeConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetTimeConversionFactor(P);
+
+ fail_unless( !Submodel_isSetTimeConversionFactor(P) );
+
+ if (Submodel_getTimeConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetTimeConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_extentConversionFactor)
+{
+ const char *extentConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetExtentConversionFactor(P) );
+
+ Submodel_setExtentConversionFactor(P, extentConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getExtentConversionFactor(P), extentConversionFactor) );
+ fail_unless( Submodel_isSetExtentConversionFactor(P) );
+
+ if (Submodel_getExtentConversionFactor(P) == extentConversionFactor)
+ {
+ fail("Submodel_setExtentConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetExtentConversionFactor(P);
+
+ fail_unless( !Submodel_isSetExtentConversionFactor(P) );
+
+ if (Submodel_getExtentConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetExtentConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_deletion)
+{
+ Deletion_t *deletion = Deletion_create(3, 1, 1);
+ const char* delname = "deletion";
+
+
+ fail_unless( Submodel_getNumDeletions(P) == 0 );
+
+ Submodel_addDeletion(P, deletion);
+
+ fail_unless( Submodel_getDeletion(P, 0) != NULL);
+ fail_unless( Submodel_getNumDeletions(P)==1 );
+
+ if (Submodel_getDeletion(P, 0) == deletion)
+ {
+ fail("Submodel_addDeletion(...) did not make a copy of the deletion.");
+ }
+
+ Submodel_removeDeletion(P, 0);
+
+ fail_unless( Submodel_getDeletion(P, 0) == NULL);
+ fail_unless( Submodel_getNumDeletions(P)==0 );
+
+ Deletion_setId(deletion, delname);
+
+ Submodel_addDeletion(P, deletion);
+ fail_unless( Submodel_getDeletionById(P, delname) != NULL);
+
+ Submodel_removeDeletionById(P, delname);
+ fail_unless( Submodel_getDeletionById(P, delname) == NULL);
+ fail_unless( Submodel_getNumDeletions(P)==0 );
+
+ Deletion_free(deletion);
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_hasRequiredAttributes )
+{
+ Submodel_t *P = Submodel_create (3, 1, 1);
+
+ fail_unless ( !Submodel_hasRequiredAttributes(P));
+
+ Submodel_setId(P, "p");
+
+ fail_unless ( !Submodel_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( Submodel_hasRequiredAttributes(P));
+
+ Submodel_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_Submodel (void)
+{
+ Suite *suite = suite_create("comp_submodel");
+ TCase *tcase = tcase_create("comp_submodel");
+
+
+ tcase_add_checked_fixture( tcase,
+ SubmodelTest_setup,
+ SubmodelTest_teardown );
+
+ tcase_add_test( tcase, test_comp_submodel_create );
+ tcase_add_test( tcase, test_comp_submodel_free_NULL );
+ tcase_add_test( tcase, test_comp_submodel_id );
+ tcase_add_test( tcase, test_comp_submodel_name );
+ tcase_add_test( tcase, test_comp_submodel_modelRef );
+ tcase_add_test( tcase, test_comp_submodel_substanceConv...
[truncated message content] |
|
From: <fbe...@us...> - 2013-11-28 15:01:49
|
Revision: 19301
http://sourceforge.net/p/sbml/code/19301
Author: fbergmann
Date: 2013-11-28 15:01:44 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
- updated cmake script, so it can find dependencies on os x mavericks
Modified Paths:
--------------
trunk/libsbml/CMakeLists.txt
Modified: trunk/libsbml/CMakeLists.txt
===================================================================
--- trunk/libsbml/CMakeLists.txt 2013-11-28 14:21:20 UTC (rev 19300)
+++ trunk/libsbml/CMakeLists.txt 2013-11-28 15:01:44 UTC (rev 19301)
@@ -288,6 +288,7 @@
find_path(LIBEXPAT_INCLUDE_DIR
NAMES expat.h
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the Expat include files."
)
@@ -321,6 +322,7 @@
NAMES libxml/parser.h
PATHS /usr/include /usr/local/include
/usr/include/libxml2
+ ${CMAKE_OSX_SYSROOT}/usr/include/libxml2
/usr/local/include/libxml2
${LIBSBML_DEPENDENCY_DIR}/include
DOC "The directory containing the libxml2 include files."
@@ -356,6 +358,7 @@
find_path(XERCES_INCLUDE_DIR
NAMES xercesc/parsers/XercesDOMParser.hpp
PATHS /usr/include /usr/local/include
+ ${CMAKE_OSX_SYSROOT}/usr/include/xercesc
/usr/include/xercesc
/usr/local/include/xercesc
${LIBSBML_DEPENDENCY_DIR}/include
@@ -382,6 +385,7 @@
find_library(LIBBZ_LIBRARY
NAMES bzip2.lib bz2 libbz2.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the bzip2 library."
)
@@ -398,10 +402,21 @@
find_path(LIBBZ_INCLUDE_DIR
NAMES bzlib.h bzip2/bzlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the bzip2 include files."
)
+ if (NOT LIBBZ_INCLUDE_DIR)
+ find_path(LIBBZ_INCLUDE_DIR
+ NAMES bzlib.h bzip2/bzlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the bzip2 include files."
+ )
+ endif()
set(USE_BZ2 ON)
add_definitions( -DUSE_BZ2 )
@@ -442,6 +457,7 @@
find_library(LIBZ_LIBRARY
NAMES zdll.lib z zlib.lib
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the zip compression library."
)
@@ -458,10 +474,21 @@
find_path(LIBZ_INCLUDE_DIR
NAMES zlib.h zlib/zlib.h
- PATHS /usr/include /usr/local/include
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
${LIBSBML_DEPENDENCY_DIR}/include
+ NO_DEFAULT_PATH
DOC "The directory containing the zlib include files."
)
+ if (NOT LIBZ_INCLUDE_DIR)
+ find_path(LIBZ_INCLUDE_DIR
+ NAMES zlib.h zlib/zlib.h
+ PATHS ${CMAKE_OSX_SYSROOT}/usr/include
+ /usr/include /usr/local/include
+ ${LIBSBML_DEPENDENCY_DIR}/include
+ DOC "The directory containing the zlib include files."
+ )
+ endif()
set(USE_ZLIB ON)
add_definitions( -DUSE_ZLIB )
@@ -704,6 +731,7 @@
find_library(LIBICONV_LIBRARY
NAMES libiconv.lib iconv.lib iconv
PATHS /usr/lib /usr/local/lib
+ ${CMAKE_OSX_SYSROOT}/usr/lib
${LIBSBML_DEPENDENCY_DIR}/lib
DOC "The file name of the libiconv library."
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 14:21:23
|
Revision: 19300
http://sourceforge.net/p/sbml/code/19300
Author: sarahkeating
Date: 2013-11-28 14:21:20 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
made getUnitsPrefix protected function
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 14:19:54 UTC (rev 19299)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 14:21:20 UTC (rev 19300)
@@ -1492,7 +1492,6 @@
virtual bool isQualifier() const;
- std::string getUnitsPrefix() const;
protected:
@@ -1523,7 +1522,7 @@
/* additional to original astnode */
bool hasCnUnits() const;
- //std::string getUnitsPrefix() const;
+ std::string getUnitsPrefix() const;
/* constructors for wrapping a number or a function node into
* a newASTNode
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 14:19:57
|
Revision: 19299
http://sourceforge.net/p/sbml/code/19299
Author: sarahkeating
Date: 2013-11-28 14:19:54 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
reverted change with tests for getUnitsPrefix as really this should be a protected function; so cannot be tested here !!
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp 2013-11-28 14:18:50 UTC (rev 19298)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp 2013-11-28 14:19:54 UTC (rev 19299)
@@ -46,13 +46,11 @@
#define MATHML_HEADER "<math xmlns='http://www.w3.org/1998/Math/MathML'>\n"
#define MATHML_HEADER_UNITS "<math xmlns='http://www.w3.org/1998/Math/MathML'\n"
#define MATHML_HEADER_UNITS2 " xmlns:sbml='http://www.sbml.org/sbml/level3/version1/core'>\n"
-#define MATHML_HEADER_UNITS3 " xmlns:other='http://www.sbml.org/sbml/level3/version1/core'>\n"
#define MATHML_FOOTER "</math>"
#define wrapXML(s) XML_HEADER s
#define wrapMathML(s) XML_HEADER MATHML_HEADER s MATHML_FOOTER
#define wrapMathMLUnits(s) XML_HEADER MATHML_HEADER_UNITS MATHML_HEADER_UNITS2 s MATHML_FOOTER
-#define wrapMathMLUnitsAlt(s) XML_HEADER MATHML_HEADER_UNITS MATHML_HEADER_UNITS3 s MATHML_FOOTER
static NewASTNode* N;
@@ -2428,14 +2426,13 @@
fail_unless( N->getReal() == 12345.7 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
- fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
START_TEST (test_element_cn_units1)
{
- const char* s = wrapMathMLUnitsAlt("<cn type=\"integer\" other:units=\"mole\"> 12345 </cn>");
+ const char* s = wrapMathMLUnits("<cn type=\"integer\" sbml:units=\"mole\"> 12345 </cn>");
N = readNewMathMLFromString(s);
@@ -2445,7 +2442,6 @@
fail_unless( N->getInteger() == 12345 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
- fail_unless( N->getUnitsPrefix() == "other" );
}
END_TEST
@@ -2462,14 +2458,13 @@
fail_unless( N->getReal() == 6.0 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
- fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
START_TEST (test_element_cn_units3)
{
- const char* s = wrapMathMLUnitsAlt("<cn type=\"e-notation\" other:units=\"mole\"> 12 <sep/> 2 </cn>");
+ const char* s = wrapMathMLUnits("<cn type=\"e-notation\" sbml:units=\"mole\"> 12 <sep/> 2 </cn>");
N = readNewMathMLFromString(s);
@@ -2479,7 +2474,6 @@
fail_unless( N->getReal() == 1200 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
- fail_unless( N->getUnitsPrefix() == "other" );
}
END_TEST
@@ -2497,7 +2491,6 @@
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
fail_unless( N->getId() == "ff" );
- fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fbe...@us...> - 2013-11-28 14:18:54
|
Revision: 19298
http://sourceforge.net/p/sbml/code/19298
Author: fbergmann
Date: 2013-11-28 14:18:50 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
- rewrote uncompress utility function, now access to uncompressed samples are easily available (even in binding libraries)
Modified Paths:
--------------
branches/libsbml-experimental/src/bindings/csharp/local-packages-spatial.i
branches/libsbml-experimental/src/bindings/java/local-packages-spatial.i
branches/libsbml-experimental/src/bindings/swig/spatial-package.i
branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/TestReadSpatialExtension.cpp
branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.cpp
branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.h
branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.cpp
branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.h
Modified: branches/libsbml-experimental/src/bindings/csharp/local-packages-spatial.i
===================================================================
--- branches/libsbml-experimental/src/bindings/csharp/local-packages-spatial.i 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/bindings/csharp/local-packages-spatial.i 2013-11-28 14:18:50 UTC (rev 19298)
@@ -40,6 +40,7 @@
/** For ImageData::getSamples() **/
%include "typemaps.i"
void ImageData::getSamples(int *outputSamples);
+void ImageData::getUncompressed(int *outputSamples);
/*** END handling arrays ***/
%ignore ImageData::getUncompressedData;
Modified: branches/libsbml-experimental/src/bindings/java/local-packages-spatial.i
===================================================================
--- branches/libsbml-experimental/src/bindings/java/local-packages-spatial.i 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/bindings/java/local-packages-spatial.i 2013-11-28 14:18:50 UTC (rev 19298)
@@ -11,6 +11,7 @@
/** For ImageData::getSamples() **/
%include "typemaps.i"
void ImageData::getSamples(int *outputSamples);
+void ImageData::getUncompressed(int *outputSamples);
/** For PolygonObject::setPointIndices() **/
%include "arrays_java.i"
Modified: branches/libsbml-experimental/src/bindings/swig/spatial-package.i
===================================================================
--- branches/libsbml-experimental/src/bindings/swig/spatial-package.i 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/bindings/swig/spatial-package.i 2013-11-28 14:18:50 UTC (rev 19298)
@@ -104,21 +104,4 @@
%include sbml/packages/spatial/extension/SpatialParameterPlugin.h
%include sbml/packages/spatial/extension/SpatialSpeciesRxnPlugin.h
-
-%extend ImageData
-{
- int getUncompressedLength()
- {
- int* data; int length;
- self->getUncompressedData(data, length);
- return length;
- }
-
- void getUncompressed(int* data)
- {
- int length;
- self->getUncompressedData(data, length);
- }
-}
-
#endif
Modified: branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/TestReadSpatialExtension.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/TestReadSpatialExtension.cpp 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/extension/test/TestReadSpatialExtension.cpp 2013-11-28 14:18:50 UTC (rev 19298)
@@ -887,11 +887,88 @@
}
END_TEST
+std::string dataToString(int* field, int numSamples1, int length)
+{
+ stringstream builder;
+ for (int i =0 ; i < length; ++i)
+ {
+ builder<< field[i] << " ";
+ if ((i+1)%numSamples1 == 0) builder << "\n";
+ }
+ return builder.str();
+}
+
#ifdef USE_ZLIB
START_TEST (test_SpatialExtension_read_compressed)
{
string filename(TestDataDirectory);
filename += "ImageTest3.xml";
+ const string expected(
+ "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 0 \n"
+ "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
+ "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n"
+ );
+
SBMLDocument* doc = readSBMLFromFile(filename.c_str());
fail_unless(doc->getModel() != NULL);
SpatialModelPlugin* plugin = (SpatialModelPlugin*)doc->getModel()->getPlugin("spatial");
@@ -904,25 +981,45 @@
SampledField* field = geometry->getSampledField();
fail_unless(field->getNumSamples1() == 57);
fail_unless(field->getNumSamples2() == 63);
- const ImageData *data = field->getImageData();
+ ImageData *data = field->getImageData();
fail_unless(data != NULL);
fail_unless(data->getDataType() == "compressed");
+ // test new API
+ int length1 = data->getUncompressedLength();
+ int* array1 = new int[length1];
+ fail_unless(length1 == 3591);
+ data->getUncompressed(array1);
+ std:string test1 = dataToString(array1, field->getNumSamples1(), length1);
+ fail_unless(test1 == expected);
+
int* result; int resultLength;
data->getUncompressedData(result, resultLength);
+
+ fail_unless(resultLength == length1);
+
+ string resultString = dataToString(result, field->getNumSamples1(), resultLength);
+
- fail_unless(resultLength == 3591);
+ fail_unless(resultString == expected);
- stringstream builder;
- for (int i =0 ; i < resultLength; ++i)
- {
- builder<< result[i] << " ";
- if ((i+1)%field->getNumSamples1() == 0) builder << "\n";
- }
+ // test new API
+ int uncompressed = data->getUncompressedLength();
+ fail_unless(resultLength == uncompressed);
+ int* more = new int[uncompressed];
+ data->getUncompressed(more);
+ resultString = dataToString(more, field->getNumSamples1(), resultLength);
+ fail_unless(resultString == expected);
+
+}
+END_TEST
+#endif
- string resultString = builder.str();
-
- string expected(
+ START_TEST (test_SpatialExtension_read_uncompressed)
+{
+ string filename(TestDataDirectory);
+ filename += "ImageTest2.xml";
+ const string expected(
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n"
"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 0 \n"
@@ -987,13 +1084,54 @@
"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 \n"
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n"
);
+ SBMLDocument* doc = readSBMLFromFile(filename.c_str());
+ fail_unless(doc->getModel() != NULL);
+ SpatialModelPlugin* plugin = (SpatialModelPlugin*)doc->getModel()->getPlugin("spatial");
+ fail_unless(plugin != NULL);
+ fail_unless(plugin->getGeometry() != NULL);
+ fail_unless(plugin->getGeometry()->getListOfGeometryDefinitions() != NULL);
+ fail_unless(plugin->getGeometry()->getListOfGeometryDefinitions()->size() == 1);
+ SampledFieldGeometry* geometry = (SampledFieldGeometry*)plugin->getGeometry()->getListOfGeometryDefinitions()->get(0);
+ fail_unless(geometry != NULL);
+ SampledField* field = geometry->getSampledField();
+ fail_unless(field->getNumSamples1() == 57);
+ fail_unless(field->getNumSamples2() == 63);
+ ImageData *data = field->getImageData();
+ fail_unless(data != NULL);
+ fail_unless(data->getDataType() == "uint8");
+
+ // test new API
+ int length1 = data->getUncompressedLength();
+ int* array1 = new int[length1];
+ fail_unless(length1 == 3591);
+ data->getUncompressed(array1);
+ std:string test1 = dataToString(array1, field->getNumSamples1(), length1);
+ fail_unless(test1 == expected);
+ int* result; int resultLength;
+ data->getUncompressedData(result, resultLength);
+
+ fail_unless(resultLength == length1);
+
+ string resultString = dataToString(result, field->getNumSamples1(), resultLength);
+
+
fail_unless(resultString == expected);
+ // test new API
+ int uncompressed = data->getUncompressedLength();
+ fail_unless(resultLength == uncompressed);
+ int* more = new int[uncompressed];
+ data->getUncompressed(more);
+ resultString = dataToString(more, field->getNumSamples1(), resultLength);
+ fail_unless(resultString == expected);
+
+
+
}
END_TEST
-#endif
+
Suite *
create_suite_ReadSpatialExtension (void)
{
@@ -1003,8 +1141,9 @@
tcase_add_test( tcase, test_SpatialExtension_read_L3V1V1);
tcase_add_test( tcase, test_SpatialExtension_read_L3V1V1_defaultNS);
tcase_add_test( tcase, test_SpatialExtension_read_L3V1V1_unknown_elements);
+ tcase_add_test( tcase, test_SpatialExtension_read_uncompressed);
#ifdef USE_ZLIB
- tcase_add_test( tcase, test_SpatialExtension_read_compressed);
+ tcase_add_test( tcase, test_SpatialExtension_read_compressed);
#endif
suite_add_tcase(suite, tcase);
Modified: branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.cpp 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.cpp 2013-11-28 14:18:50 UTC (rev 19298)
@@ -83,6 +83,8 @@
, mDataType("")
, mSamples(NULL)
, mSamplesLength(0)
+ , mUncompressedSamples(NULL)
+ , mUncompressedLength(0)
, mURI("")
, mParentSBMLObject(NULL)
, mSBMLNamespaces(NULL)
@@ -119,6 +121,8 @@
, mDataType("")
, mSamples(NULL)
, mSamplesLength(0)
+ , mUncompressedSamples(NULL)
+ , mUncompressedLength(0)
, mURI("")
, mParentSBMLObject(NULL)
, mSBMLNamespaces(NULL)
@@ -154,6 +158,8 @@
, mDataType(source.mDataType)
, mSamples(NULL)
, mSamplesLength(source.mSamplesLength)
+ , mUncompressedSamples(NULL)
+ , mUncompressedLength(0)
, mURI(source.mURI)
, mParentSBMLObject(NULL)
, mSBMLNamespaces(NULL)
@@ -175,6 +181,8 @@
{
this->mDataType = source.mDataType;
this->mSamplesLength = source.mSamplesLength;
+ mUncompressedSamples = NULL;
+ mUncompressedLength = 0;
if (source.mSamples != NULL)
{
this->mSamples = new int[mSamplesLength];
@@ -202,6 +210,7 @@
// destroy 'samples' array here --- ???
delete[] mSamples;
mSamplesLength = 0;
+ freeUncompressed();
}
/*
@@ -223,13 +232,10 @@
void
ImageData::getSamples (int* outputSamples) const
{
- if (outputSamples == NULL) {
- throw SBMLExtensionException("Cannot return null or 0-length array");
- }
+ if (outputSamples == NULL) return;
memcpy(outputSamples , mSamples, sizeof(int)*mSamplesLength);
- // return mSamples;
}
unsigned int
@@ -286,6 +292,7 @@
mSamples = new int[mSamplesLength];
memcpy(mSamples, samples, sizeof(int)*samplesLength);
mIsSetSamples = true;
+ freeUncompressed();
return LIBSBML_OPERATION_SUCCESS;
}
}
@@ -317,6 +324,7 @@
if (!isSetSamples())
{
+ freeUncompressed();
return LIBSBML_OPERATION_SUCCESS;
}
else
@@ -487,6 +495,15 @@
return mURI;
}
+void
+ImageData::copySampleArrays(int* &target, int& targetLength, int* source, int sourceLength)
+{
+ targetLength = sourceLength;
+ target = (int*)malloc(sizeof(int)*sourceLength);
+ memset(target, 0, sizeof(int)*sourceLength);
+ memcpy(target, source, sizeof(int)*sourceLength);
+}
+
/**
* Returns the data of this image as uncompressed array of integers
*
@@ -496,30 +513,72 @@
*
*/
void
-ImageData::getUncompressedData(int* &data, int& length) const
+ ImageData::getUncompressedData(int* &data, int& length)
{
+ if (mUncompressedSamples == NULL)
+ {
+ uncompress();
+ }
+
+ copySampleArrays(data, length, mUncompressedSamples, mUncompressedLength);
+ return;
+
+}
+
+void
+ImageData::uncompress()
+{
+ freeUncompressed();
if (mDataType.empty() || mDataType == "compressed")
{
char* csamples = (char*)malloc(sizeof(char)*mSamplesLength);
for (unsigned int i = 0 ; i < mSamplesLength; ++i)
csamples[i] = mSamples[i];
- ImageData::uncompress_data(csamples, mSamplesLength, data, length);
+ ImageData::uncompress_data(csamples, mSamplesLength, mUncompressedSamples, mUncompressedLength);
free(csamples);
}
else
{
- // lets just return a copy of the data we have as they ought to be uncompressed
- length = mSamplesLength;
- data = (int*)malloc(sizeof(int)*mSamplesLength);
- memcpy(mSamples, data, sizeof(int)*length);
+ copySampleArrays(mUncompressedSamples, mUncompressedLength, mSamples, mSamplesLength);
}
+
}
+unsigned int
+ImageData::getUncompressedLength()
+{
+ if (mUncompressedSamples == NULL)
+ uncompress();
+ return mUncompressedLength;
+}
+
void
+ImageData::getUncompressed(int* outputSamples)
+{
+ if (outputSamples == NULL) return;
+ if (mUncompressedSamples == NULL)
+ uncompress();
+ memcpy(outputSamples , mUncompressedSamples, sizeof(int)*mUncompressedLength);
+}
+
+void
+ImageData::freeUncompressed()
+{
+ if (mUncompressedSamples == NULL) return;
+ mUncompressedLength = 0;
+ free(mUncompressedSamples);
+ mUncompressedSamples = NULL;
+}
+
+
+void
ImageData::uncompress_data(void *data, size_t length, int*& result, int& outLength)
{
#ifndef USE_ZLIB
- throw ZlibNotLinked();
+ // throwing an exception won't help our users, better set the result array and length to NULL.
+ // throw ZlibNotLinked();
+ outLength = 0;
+ result = NULL;
#else
std::vector<char> buffer;
Modified: branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.h
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.h 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/sbml/ImageData.h 2013-11-28 14:18:50 UTC (rev 19298)
@@ -45,6 +45,8 @@
std::string mDataType;
int* mSamples;
unsigned int mSamplesLength;
+ int* mUncompressedSamples;
+ int mUncompressedLength;
std::string mURI;
SBase* mParentSBMLObject;
@@ -52,6 +54,8 @@
bool mIsSetSamples;
+ static void copySampleArrays(int* &target, int& targetLength, int* source, int sourceLength);
+
public:
/**
@@ -106,6 +110,32 @@
*
* @return the "samplesLength" attribute of this ImageData.
*/
+ unsigned int getUncompressedLength();
+
+ /**
+ * The "samples" attribute of this ImageData is returned in an int array (pointer)
+ * that is passed as argument to the method (this is needed while using SWIG to
+ * convert int[] from C++ to Java). This method returns the uncompressed sample field.
+ *
+ * @return void.
+ */
+ void getUncompressed(int* outputSamples);
+
+ /**
+ * utility function freeing the uncompressed data.
+ */
+ void freeUncompressed();
+
+ /**
+ * utility function uncompressing samples
+ */
+ void uncompress();
+
+ /**
+ * Returns the "samplesLength" attribute of this ImageData.
+ *
+ * @return the "samplesLength" attribute of this ImageData.
+ */
unsigned int getSamplesLength() const;
/**
@@ -259,7 +289,7 @@
* @param length the output lenght of the array
*
*/
- void getUncompressedData(int* &data, int& length) const;
+ void getUncompressedData(int* &data, int& length);
protected:
Modified: branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.cpp
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.cpp 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.cpp 2013-11-28 14:18:50 UTC (rev 19298)
@@ -227,6 +227,16 @@
}
/*
+ * Returns the "imageData" of this SampledField.
+ */
+ImageData*
+SampledField::getImageData ()
+{
+ return mImageData;
+}
+
+
+/*
* Predicate returning @c true or @c false depending on whether this
* SampledField's "spatialId" attribute has been set.
*/
Modified: branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.h
===================================================================
--- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.h 2013-11-28 14:04:09 UTC (rev 19297)
+++ branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SampledField.h 2013-11-28 14:18:50 UTC (rev 19298)
@@ -148,6 +148,13 @@
const ImageData* getImageData() const;
/**
+ * Returns the "imageData" attribute of this SampledField.
+ *
+ * @return the "imageData" attribute of this SampledField.
+ */
+ ImageData* getImageData();
+
+ /**
* Predicate returning @c true or @c false depending on whether this
* SampledField's "spatialId" attribute has been set.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 14:04:11
|
Revision: 19297
http://sourceforge.net/p/sbml/code/19297
Author: sarahkeating
Date: 2013-11-28 14:04:09 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
changed the units prefix member name and functions to use UnitsPrefix rather than just prefix - as this gets confusing with xml prefix
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.cpp
branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.h
branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.cpp 2013-11-28 12:25:37 UTC (rev 19296)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.cpp 2013-11-28 14:04:09 UTC (rev 19297)
@@ -39,7 +39,7 @@
ASTCnBase::ASTCnBase (int type) :
ASTBase ( type )
, mUnits ("")
- , mPrefix ("")
+ , mUnitsPrefix ("")
{
}
@@ -50,7 +50,7 @@
ASTCnBase::ASTCnBase (const ASTCnBase& orig):
ASTBase ( orig)
, mUnits (orig.mUnits)
- , mPrefix (orig.mPrefix)
+ , mUnitsPrefix (orig.mUnitsPrefix)
{
}
@@ -65,7 +65,7 @@
{
this->ASTBase::operator =(rhs);
mUnits = rhs.mUnits;
- mPrefix = rhs.mPrefix;
+ mUnitsPrefix = rhs.mUnitsPrefix;
}
return *this;
}
@@ -130,23 +130,23 @@
std::string
-ASTCnBase::getPrefix() const
+ASTCnBase::getUnitsPrefix() const
{
- return mPrefix;
+ return mUnitsPrefix;
}
bool
-ASTCnBase::isSetPrefix() const
+ASTCnBase::isSetUnitsPrefix() const
{
- return (mPrefix.empty() == false);
+ return (mUnitsPrefix.empty() == false);
}
int
-ASTCnBase::setPrefix(std::string prefix)
+ASTCnBase::setUnitsPrefix(std::string prefix)
{
- mPrefix = prefix;
+ mUnitsPrefix = prefix;
return LIBSBML_OPERATION_SUCCESS;
}
@@ -156,9 +156,9 @@
{
if (isSetUnits() == true)
{
- if (isSetPrefix() == true)
+ if (isSetUnitsPrefix() == true)
{
- stream.writeAttribute("units", getPrefix(), getUnits());
+ stream.writeAttribute("units", getUnitsPrefix(), getUnits());
}
else
{
@@ -220,7 +220,7 @@
prefix = element.getAttrPrefix(
element.getAttrIndex("units", stream.getSBMLNamespaces()->getURI()));
- setPrefix(prefix);
+ setUnitsPrefix(prefix);
}
//return ASTBase::read(stream);
@@ -234,8 +234,8 @@
ASTCnBase::syncMembers(ASTCnBase* rhs)
{
ASTBase::syncMembers(rhs);
- mUnits = rhs->mUnits;
- mPrefix = rhs->mPrefix;
+ mUnits = rhs->mUnits;
+ mUnitsPrefix = rhs->mUnitsPrefix;
}
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.h 2013-11-28 12:25:37 UTC (rev 19296)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnBase.h 2013-11-28 14:04:09 UTC (rev 19297)
@@ -87,11 +87,11 @@
int unsetUnits();
- std::string getPrefix() const;
+ std::string getUnitsPrefix() const;
- bool isSetPrefix() const;
+ bool isSetUnitsPrefix() const;
- int setPrefix(std::string Prefix);
+ int setUnitsPrefix(std::string prefix);
virtual void syncMembers(ASTCnBase* rhs);
@@ -105,7 +105,7 @@
/* member variables */
std::string mUnits;
- std::string mPrefix;
+ std::string mUnitsPrefix;
};
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp 2013-11-28 12:25:37 UTC (rev 19296)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp 2013-11-28 14:04:09 UTC (rev 19297)
@@ -829,19 +829,19 @@
if (mExponential != NULL)
{
- prefix = mExponential->ASTCnBase::getPrefix();
+ prefix = mExponential->getUnitsPrefix();
}
else if (mInteger != NULL)
{
- prefix = mInteger->ASTCnBase::getPrefix();
+ prefix = mInteger->getUnitsPrefix();
}
else if (mRational != NULL)
{
- prefix = mRational->ASTCnBase::getPrefix();
+ prefix = mRational->getUnitsPrefix();
}
else if (mReal != NULL)
{
- prefix = mReal->ASTCnBase::getPrefix();
+ prefix = mReal->getUnitsPrefix();
}
return prefix;
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 12:25:37 UTC (rev 19296)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 14:04:09 UTC (rev 19297)
@@ -1492,6 +1492,7 @@
virtual bool isQualifier() const;
+ std::string getUnitsPrefix() const;
protected:
@@ -1522,7 +1523,7 @@
/* additional to original astnode */
bool hasCnUnits() const;
- std::string getUnitsPrefix() const;
+ //std::string getUnitsPrefix() const;
/* constructors for wrapping a number or a function node into
* a newASTNode
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp 2013-11-28 12:25:37 UTC (rev 19296)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewReadMathML.cpp 2013-11-28 14:04:09 UTC (rev 19297)
@@ -46,11 +46,13 @@
#define MATHML_HEADER "<math xmlns='http://www.w3.org/1998/Math/MathML'>\n"
#define MATHML_HEADER_UNITS "<math xmlns='http://www.w3.org/1998/Math/MathML'\n"
#define MATHML_HEADER_UNITS2 " xmlns:sbml='http://www.sbml.org/sbml/level3/version1/core'>\n"
+#define MATHML_HEADER_UNITS3 " xmlns:other='http://www.sbml.org/sbml/level3/version1/core'>\n"
#define MATHML_FOOTER "</math>"
#define wrapXML(s) XML_HEADER s
#define wrapMathML(s) XML_HEADER MATHML_HEADER s MATHML_FOOTER
#define wrapMathMLUnits(s) XML_HEADER MATHML_HEADER_UNITS MATHML_HEADER_UNITS2 s MATHML_FOOTER
+#define wrapMathMLUnitsAlt(s) XML_HEADER MATHML_HEADER_UNITS MATHML_HEADER_UNITS3 s MATHML_FOOTER
static NewASTNode* N;
@@ -2426,13 +2428,14 @@
fail_unless( N->getReal() == 12345.7 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
+ fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
START_TEST (test_element_cn_units1)
{
- const char* s = wrapMathMLUnits("<cn type=\"integer\" sbml:units=\"mole\"> 12345 </cn>");
+ const char* s = wrapMathMLUnitsAlt("<cn type=\"integer\" other:units=\"mole\"> 12345 </cn>");
N = readNewMathMLFromString(s);
@@ -2442,6 +2445,7 @@
fail_unless( N->getInteger() == 12345 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
+ fail_unless( N->getUnitsPrefix() == "other" );
}
END_TEST
@@ -2458,13 +2462,14 @@
fail_unless( N->getReal() == 6.0 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
+ fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
START_TEST (test_element_cn_units3)
{
- const char* s = wrapMathMLUnits("<cn type=\"e-notation\" sbml:units=\"mole\"> 12 <sep/> 2 </cn>");
+ const char* s = wrapMathMLUnitsAlt("<cn type=\"e-notation\" other:units=\"mole\"> 12 <sep/> 2 </cn>");
N = readNewMathMLFromString(s);
@@ -2474,6 +2479,7 @@
fail_unless( N->getReal() == 1200 );
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
+ fail_unless( N->getUnitsPrefix() == "other" );
}
END_TEST
@@ -2491,6 +2497,7 @@
fail_unless( N->getUnits() == "mole" );
fail_unless( N->getNumChildren() == 0 );
fail_unless( N->getId() == "ff" );
+ fail_unless( N->getUnitsPrefix() == "sbml" );
}
END_TEST
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 12:25:40
|
Revision: 19296
http://sourceforge.net/p/sbml/code/19296
Author: sarahkeating
Date: 2013-11-28 12:25:37 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
the user data member variable should have gone on my base AST class
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/ASTBase.cpp
branches/libsbml-ast-plugin/src/sbml/math/ASTBase.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.cpp
branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.h
branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.cpp
branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.h
branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp
branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.h
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTBase.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTBase.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTBase.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -217,6 +217,7 @@
, mClass ("")
, mStyle ("")
, mParentSBMLObject ( NULL )
+ , mUserData ( NULL )
{
setType(type);
@@ -234,6 +235,7 @@
, mClass (orig.mClass)
, mStyle (orig.mStyle)
, mParentSBMLObject (orig.mParentSBMLObject)
+ , mUserData (orig.mUserData)
{
mPlugins.resize( orig.mPlugins.size() );
transform( orig.mPlugins.begin(), orig.mPlugins.end(),
@@ -259,6 +261,7 @@
mClass = rhs.mClass;
mStyle = rhs.mStyle;
mParentSBMLObject = rhs.mParentSBMLObject;
+ mUserData = rhs.mUserData;
for_each( mPlugins.begin(), mPlugins.end(), DeletePluginEntity() );
mPlugins.resize( rhs.mPlugins.size() );
@@ -987,6 +990,30 @@
}
+int
+ASTBase::setUserData(void *userData)
+{
+ mUserData = userData;
+ if (mUserData != NULL)
+ {
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+ else
+ {
+ return LIBSBML_OPERATION_FAILED;
+ }
+}
+
+
+void *
+ASTBase::getUserData() const
+{
+ return mUserData;
+}
+
+
+
+
void
ASTBase::write(XMLOutputStream& stream) const
{
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTBase.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTBase.h 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTBase.h 2013-11-28 12:25:37 UTC (rev 19296)
@@ -272,6 +272,9 @@
int getTypeFromName(const std::string& name) const;
const char * getNameFromType(int type) const;
+
+ virtual int setUserData(void *userData);
+ virtual void *getUserData() const;
protected:
void writeStartEndElement(XMLOutputStream& stream) const;
@@ -306,6 +309,8 @@
SBase * mParentSBMLObject;
+ void * mUserData;
+
//char mChar;
//----------------------------------------------------------------------
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -300,6 +300,31 @@
int
+ASTCSymbol::setUserData(void* userData)
+{
+ int success = ASTBase::setUserData(userData);
+
+ if (success == LIBSBML_OPERATION_SUCCESS)
+ {
+ if (mTime != NULL)
+ {
+ success = mTime->ASTBase::setUserData(userData);
+ }
+ else if (mDelay != NULL)
+ {
+ success = mDelay->ASTBase::setUserData(userData);
+ }
+ else if (mAvogadro != NULL)
+ {
+ success = mAvogadro->ASTBase::setUserData(userData);
+ }
+ }
+
+ return success;
+}
+
+
+int
ASTCSymbol::unsetClass()
{
int success = ASTBase::unsetClass();
@@ -470,6 +495,13 @@
}
+void*
+ASTCSymbol::getUserData() const
+{
+ return ASTBase::getUserData();
+}
+
+
int
ASTCSymbol::setValue(double value)
{
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.h 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCSymbol.h 2013-11-28 12:25:37 UTC (rev 19296)
@@ -96,6 +96,9 @@
int unsetId();
int unsetStyle();
int unsetUnits();
+ virtual int setUserData(void *userData);
+ virtual void *getUserData() const;
+
virtual int addChild(ASTBase * child);
virtual ASTBase* getChild (unsigned int n) const;
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -1213,7 +1213,63 @@
return ASTBase::getStyle();
}
+int
+ASTFunction::setUserData(void* userData)
+{
+ int success = ASTBase::setUserData(userData);
+ if (success == LIBSBML_OPERATION_SUCCESS)
+ {
+ if (mUnaryFunction != NULL)
+ {
+ success = mUnaryFunction->setUserData(userData);
+ }
+ else if (mBinaryFunction != NULL)
+ {
+ success = mBinaryFunction->setUserData(userData);
+ }
+ else if (mNaryFunction != NULL)
+ {
+ success = mNaryFunction->setUserData(userData);
+ }
+ else if (mUserFunction != NULL)
+ {
+ success = mUserFunction->setUserData(userData);
+ }
+ else if (mLambda != NULL)
+ {
+ success = mLambda->setUserData(userData);
+ }
+ else if (mPiecewise != NULL)
+ {
+ success = mPiecewise->setUserData(userData);
+ }
+ else if (mCSymbol != NULL)
+ {
+ success = mCSymbol->setUserData(userData);
+ }
+ else if (mQualifier != NULL)
+ {
+ success = mQualifier->setUserData(userData);
+ }
+ else if (mSemantics != NULL)
+ {
+ success = mSemantics->setUserData(userData);
+ }
+ }
+
+ return success;
+}
+
+
+void*
+ASTFunction::getUserData() const
+{
+ return ASTBase::getUserData();
+}
+
+
+
const std::string&
ASTFunction::getName() const
{
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.h 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTFunction.h 2013-11-28 12:25:37 UTC (rev 19296)
@@ -98,6 +98,9 @@
int unsetStyle();
+ virtual int setUserData(void *userData);
+ virtual void *getUserData() const;
+
int addChild(ASTBase * child);
ASTBase* getChild (unsigned int n) const;
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -402,6 +402,47 @@
int
+ASTNumber::setUserData(void* userData)
+{
+ int success = ASTBase::setUserData(userData);
+
+ if (success == LIBSBML_OPERATION_SUCCESS)
+ {
+ if (mExponential != NULL)
+ {
+ success = mExponential->ASTBase::setUserData(userData);
+ }
+ else if (mInteger != NULL)
+ {
+ success = mInteger->ASTBase::setUserData(userData);
+ }
+ else if (mRational != NULL)
+ {
+ success = mRational->ASTBase::setUserData(userData);
+ }
+ else if (mReal != NULL)
+ {
+ success = mReal->ASTBase::setUserData(userData);
+ }
+ else if (mCiNumber != NULL)
+ {
+ success = mCiNumber->setUserData(userData);
+ }
+ else if (mConstant != NULL)
+ {
+ success = mConstant->setUserData(userData);
+ }
+ else if (mCSymbol != NULL)
+ {
+ success = mCSymbol->setUserData(userData);
+ }
+ }
+
+ return success;
+}
+
+
+int
ASTNumber::unsetClass()
{
int success = ASTBase::unsetClass();
@@ -745,7 +786,14 @@
return units;
}
+void*
+ASTNumber::getUserData() const
+{
+ return ASTBase::getUserData();
+}
+
+
bool
ASTNumber::hasCnUnits() const
{
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.h 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTNumber.h 2013-11-28 12:25:37 UTC (rev 19296)
@@ -100,6 +100,9 @@
int unsetStyle();
int unsetUnits();
+ virtual int setUserData(void *userData);
+ virtual void *getUserData() const;
+
double getMantissa() const;
bool isSetMantissa() const;
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -43,7 +43,6 @@
ASTBase (type)
, mNumber ( NULL )
, mFunction ( NULL )
- , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -87,7 +86,6 @@
ASTBase (number->getType())
, mNumber ( number )
, mFunction ( NULL )
- , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -96,7 +94,6 @@
ASTBase (function->getType())
, mNumber ( NULL )
, mFunction ( function )
- , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -106,7 +103,6 @@
{
mNumber = NULL;
mFunction = NULL;
- mUserData = NULL;
mChar = 0;
mHistoricalName = "";
@@ -148,7 +144,6 @@
ASTBase(orig)
, mNumber ( NULL )
, mFunction ( NULL )
- , mUserData ( orig.mUserData)
, mChar (orig.mChar)
, mHistoricalName (orig.mHistoricalName)
{
@@ -173,7 +168,6 @@
this->ASTBase::operator =(rhs);
mNumber = rhs.mNumber;
mFunction = rhs.mFunction;
- mUserData = rhs.mUserData;
mChar = rhs.mChar;
mHistoricalName = rhs.mHistoricalName;
@@ -2531,22 +2525,28 @@
int
NewASTNode::setUserData(void *userData)
{
- this->mUserData = userData;
- if (mUserData != NULL)
+ int success = ASTBase::setUserData(userData);
+
+ if (success == LIBSBML_OPERATION_SUCCESS)
{
- return LIBSBML_OPERATION_SUCCESS;
+ if (mNumber != NULL)
+ {
+ success = mNumber->setUserData(userData);
+ }
+ else if (mFunction != NULL)
+ {
+ success = mFunction->setUserData(userData);
+ }
}
- else
- {
- return LIBSBML_OPERATION_FAILED;
- }
+
+ return success;
}
void *
NewASTNode::getUserData() const
{
- return this->mUserData;
+ return ASTBase::getUserData();
}
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 12:25:37 UTC (rev 19296)
@@ -1428,7 +1428,7 @@
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink
*/
- int setUserData(void *userData);
+ virtual int setUserData(void *userData);
/**
@@ -1440,7 +1440,7 @@
* @see ASTNode::setUserData
* @endif@~
*/
- void *getUserData() const;
+ virtual void *getUserData() const;
/**
@@ -1499,7 +1499,6 @@
ASTNumber * mNumber;
ASTFunction * mFunction;
- void *mUserData;
/* put this here for historical purposes */
char mChar;
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 11:35:59 UTC (rev 19295)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 12:25:37 UTC (rev 19296)
@@ -4384,6 +4384,94 @@
END_TEST
+START_TEST (test_NewASTNode_userData_1)
+{
+ NewASTNode *n = new NewASTNode(AST_PLUS);
+
+ Model * m = new Model(3,1);
+
+ fail_unless(n->getUserData() == NULL);
+
+ n->setUserData((void*)(m));
+
+ fail_unless(n->getUserData() != NULL);
+ fail_unless(n->getUserData() == m);
+
+ n->setUserData(NULL);
+
+ fail_unless(n->getUserData() == NULL);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_userData_2)
+{
+ NewASTNode *n = new NewASTNode(AST_INTEGER);
+
+ Model * m = new Model(3,1);
+
+ fail_unless(n->getUserData() == NULL);
+
+ n->setUserData((void*)(m));
+
+ fail_unless(n->getUserData() != NULL);
+ fail_unless(n->getUserData() == m);
+
+ n->setUserData(NULL);
+
+ fail_unless(n->getUserData() == NULL);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_userData_3)
+{
+ NewASTNode *n = new NewASTNode(AST_NAME_TIME);
+
+ Model * m = new Model(3,1);
+
+ fail_unless(n->getUserData() == NULL);
+
+ n->setUserData((void*)(m));
+
+ fail_unless(n->getUserData() != NULL);
+ fail_unless(n->getUserData() == m);
+
+ n->setUserData(NULL);
+
+ fail_unless(n->getUserData() == NULL);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_userData_4)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION_DELAY);
+
+ Model * m = new Model(3,1);
+
+ fail_unless(n->getUserData() == NULL);
+
+ n->setUserData((void*)(m));
+
+ fail_unless(n->getUserData() != NULL);
+ fail_unless(n->getUserData() == m);
+
+ n->setUserData(NULL);
+
+ fail_unless(n->getUserData() == NULL);
+
+ delete n;
+}
+END_TEST
+
+
Suite *
create_suite_NewASTNode (void)
{
@@ -4477,6 +4565,10 @@
//tcase_add_test( tcase, test_NewASTNode_replaceIDWithFunction_1 );
tcase_add_test( tcase, test_NewASTNode_replaceIDWithFunction_2 );
tcase_add_test( tcase, test_NewASTNode_reduceToBinary );
+ tcase_add_test( tcase, test_NewASTNode_userData_1 );
+ tcase_add_test( tcase, test_NewASTNode_userData_2 );
+ tcase_add_test( tcase, test_NewASTNode_userData_3 );
+ tcase_add_test( tcase, test_NewASTNode_userData_4 );
suite_add_tcase(suite, tcase);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 11:36:02
|
Revision: 19295
http://sourceforge.net/p/sbml/code/19295
Author: sarahkeating
Date: 2013-11-28 11:35:59 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
since I ended up noy using multiple inheritance do not need classes to be virtual
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/ASTBinaryFunctionNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCiNumberNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCnExponentialNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCnIntegerNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCnRationalNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTCnRealNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTConstantNumberNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTQualifierNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTSemanticsNode.h
branches/libsbml-ast-plugin/src/sbml/math/ASTUnaryFunctionNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTBinaryFunctionNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTBinaryFunctionNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTBinaryFunctionNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTBinaryFunctionNode : public virtual ASTFunctionBase
+class LIBSBML_EXTERN ASTBinaryFunctionNode : public ASTFunctionBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCiNumberNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCiNumberNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCiNumberNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTCiNumberNode: virtual public ASTBase
+class LIBSBML_EXTERN ASTCiNumberNode: public ASTBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnExponentialNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnExponentialNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnExponentialNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTCnExponentialNode: virtual public ASTCnBase
+class LIBSBML_EXTERN ASTCnExponentialNode: public ASTCnBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnIntegerNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnIntegerNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnIntegerNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTCnIntegerNode: virtual public ASTCnBase
+class LIBSBML_EXTERN ASTCnIntegerNode: public ASTCnBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnRationalNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnRationalNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnRationalNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTCnRationalNode: virtual public ASTCnBase
+class LIBSBML_EXTERN ASTCnRationalNode: public ASTCnBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTCnRealNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTCnRealNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTCnRealNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTCnRealNode: virtual public ASTCnBase
+class LIBSBML_EXTERN ASTCnRealNode: public ASTCnBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTConstantNumberNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTConstantNumberNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTConstantNumberNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTConstantNumberNode: virtual public ASTBase
+class LIBSBML_EXTERN ASTConstantNumberNode: public ASTBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTQualifierNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTQualifierNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTQualifierNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -38,7 +38,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTQualifierNode : virtual public ASTFunctionBase
+class LIBSBML_EXTERN ASTQualifierNode : public ASTFunctionBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTSemanticsNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTSemanticsNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTSemanticsNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -43,7 +43,7 @@
-class LIBSBML_EXTERN ASTSemanticsNode : public virtual ASTFunctionBase
+class LIBSBML_EXTERN ASTSemanticsNode : public ASTFunctionBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTUnaryFunctionNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTUnaryFunctionNode.h 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTUnaryFunctionNode.h 2013-11-28 11:35:59 UTC (rev 19295)
@@ -42,7 +42,7 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class LIBSBML_EXTERN ASTUnaryFunctionNode : public virtual ASTFunctionBase
+class LIBSBML_EXTERN ASTUnaryFunctionNode : public ASTFunctionBase
{
public:
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 09:48:26 UTC (rev 19294)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 11:35:59 UTC (rev 19295)
@@ -4180,10 +4180,10 @@
c->setName("x");
n->addChild(c);
- //n->setType(AST_FUNCTION_PIECEWISE);
- //fail_unless( n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 1));
- //fail_unless(!n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 0));
- fail_unless( n->hasTypeAndNumChildren(AST_PLUS, 1));
+ n->setType(AST_FUNCTION_PIECEWISE);
+ fail_unless( n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 1));
+ fail_unless(!n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 1));
fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 0));
fail_unless(!n->hasTypeAndNumChildren(AST_LOGICAL_AND, 1));
fail_unless(!n->hasTypeAndNumChildren(AST_DIVIDE, 0));
@@ -4191,11 +4191,11 @@
c = new NewASTNode();
c->setName("y");
n->addChild(c);
- //n->setType(AST_DIVIDE);
- //fail_unless( n->hasTypeAndNumChildren(AST_DIVIDE, 2));
- //fail_unless(!n->hasTypeAndNumChildren(AST_DIVIDE, 0));
- fail_unless( n->hasTypeAndNumChildren(AST_PLUS, 2));
- fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 0));
+ n->setType(AST_DIVIDE);
+ fail_unless( n->hasTypeAndNumChildren(AST_DIVIDE, 2));
+ fail_unless(!n->hasTypeAndNumChildren(AST_DIVIDE, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 2));
+ fail_unless(!n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 0));
fail_unless(!n->hasTypeAndNumChildren(AST_CONSTANT_E, 2));
fail_unless(!n->hasTypeAndNumChildren(AST_RELATIONAL_EQ, 0));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-28 09:48:28
|
Revision: 19294
http://sourceforge.net/p/sbml/code/19294
Author: sarahkeating
Date: 2013-11-28 09:48:26 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
added the constructor that uses a token
this is so the old formula parsers will still work
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-28 05:59:31 UTC (rev 19293)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-28 09:48:26 UTC (rev 19294)
@@ -101,6 +101,46 @@
, mHistoricalName ("")
{
}
+
+NewASTNode::NewASTNode (Token_t* token)
+{
+ mNumber = NULL;
+ mFunction = NULL;
+ mUserData = NULL;
+ mChar = 0;
+ mHistoricalName = "";
+
+ if (token != NULL)
+ {
+ if (token->type == TT_NAME)
+ {
+ mFunction = new ASTFunction(AST_FUNCTION);
+ setName(token->value.name);
+ }
+ else if (token->type == TT_INTEGER)
+ {
+ mNumber = new ASTNumber(AST_INTEGER);
+ setValue(token->value.integer);
+ }
+ else if (token->type == TT_REAL)
+ {
+ mNumber = new ASTNumber(AST_REAL);
+ setValue(token->value.real);
+ }
+ else if (token->type == TT_REAL_E)
+ {
+ mNumber = new ASTNumber(AST_REAL_E);
+ setValue(token->value.real, token->exponent);
+ }
+ else
+ {
+ mFunction = new ASTFunction();
+ setCharacter(token->value.ch);
+ }
+ }
+}
+
+
/**
* Copy constructor
*/
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 05:59:31 UTC (rev 19293)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-28 09:48:26 UTC (rev 19294)
@@ -169,6 +169,15 @@
/**
+ * Creates a new ASTNode from the given Token. The resulting ASTNode
+ * will contain the same data as the Token.
+ *
+ * @param token the Token to add.
+ */
+ NewASTNode (Token_t *token);
+
+
+ /**
* Copy constructor; creates a deep copy of the given ASTNode.
*
* @param orig the ASTNode to be copied.
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 05:59:31 UTC (rev 19293)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-28 09:48:26 UTC (rev 19294)
@@ -80,139 +80,139 @@
ASTNode_free(NULL);
}
END_TEST
-//
-//
-//START_TEST (test_NewASTNode_createFromToken)
-//{
-// const char *formula = "foo 2 4.0 .272e1 +-*/^@";
-// FormulaTokenizer_t *ft = FormulaTokenizer_createFromFormula(formula);
-//
-// Token_t *t;
-// NewASTNode_t *n;
-// EventAssignment_t *ea =
-// EventAssignment_create(2, 4);
-//
-//
-// /** "foo" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType() == AST_NAME );
-// fail_unless( !strcmp(NewASTNode_getName(n), "foo") );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// fail_unless( NewASTNode_getParentSBMLObject(n) == NULL );
-//
-// EventAssignment_free(ea);
-//
-// Token_free(t);
-// delete n;
-//
-// /** "2" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_INTEGER );
-// fail_unless( NewASTNode_getInteger (n) == 2 );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "4.0" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_REAL );
-// fail_unless( NewASTNode_getReal (n) == 4.0 );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** ".272e1" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_REAL_E );
-// fail_unless( NewASTNode_getMantissa (n) == .272 );
-// fail_unless( NewASTNode_getExponent (n) == 1 );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "+" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_PLUS );
-// fail_unless( NewASTNode_getCharacter (n) == '+' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "-" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_MINUS );
-// fail_unless( NewASTNode_getCharacter (n) == '-' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "*" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_TIMES );
-// fail_unless( NewASTNode_getCharacter (n) == '*' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "/" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_DIVIDE );
-// fail_unless( NewASTNode_getCharacter (n) == '/' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "^" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_POWER );
-// fail_unless( NewASTNode_getCharacter (n) == '^' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// /** "@" **/
-// t = FormulaTokenizer_nextToken(ft);
-// n = NewASTNode_createFromToken(t);
-//
-// fail_unless( NewASTNode_getType (n) == AST_UNKNOWN );
-// fail_unless( NewASTNode_getCharacter (n) == '@' );
-// fail_unless( NewASTNode_getNumChildren(n) == 0 );
-//
-// Token_free(t);
-// delete n;
-//
-// FormulaTokenizer_free(ft);
-//}
-//END_TEST
-//
-//
+
+
+START_TEST (test_NewASTNode_createFromToken)
+{
+ const char *formula = "foo 2 4.0 .272e1 +-*/^@";
+ FormulaTokenizer_t *ft = FormulaTokenizer_createFromFormula(formula);
+
+ Token_t *t;
+ NewASTNode *n;
+ EventAssignment_t *ea =
+ EventAssignment_create(2, 4);
+
+
+ /** "foo" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType() == AST_NAME );
+ fail_unless( !strcmp(n->getName(), "foo") );
+ fail_unless( n->getNumChildren() == 0 );
+
+ fail_unless( n->getParentSBMLObject() == NULL );
+
+ EventAssignment_free(ea);
+
+ Token_free(t);
+ delete n;
+
+ /** "2" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_INTEGER );
+ fail_unless( n->getInteger () == 2 );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "4.0" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_REAL );
+ fail_unless( n->getReal () == 4.0 );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** ".272e1" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_REAL_E );
+ fail_unless( n->getMantissa () == .272 );
+ fail_unless( n->getExponent () == 1 );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "+" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_PLUS );
+ fail_unless( n->getCharacter () == '+' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "-" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_MINUS );
+ fail_unless( n->getCharacter () == '-' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "*" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_TIMES );
+ fail_unless( n->getCharacter () == '*' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "/" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_DIVIDE );
+ fail_unless( n->getCharacter () == '/' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "^" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_POWER );
+ fail_unless( n->getCharacter () == '^' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ /** "@" **/
+ t = FormulaTokenizer_nextToken(ft);
+ n = new NewASTNode(t);
+
+ fail_unless( n->getType () == AST_UNKNOWN );
+ fail_unless( n->getCharacter () == '@' );
+ fail_unless( n->getNumChildren() == 0 );
+
+ Token_free(t);
+ delete n;
+
+ FormulaTokenizer_free(ft);
+}
+END_TEST
+
+
START_TEST (test_NewASTNode_canonicalizeConstants)
{
NewASTNode *n = new NewASTNode();
@@ -4398,9 +4398,7 @@
tcase_add_test( tcase, test_NewASTNode_getRealE );
tcase_add_test( tcase, test_NewASTNode_free_NULL );
- // do we need these for the new stuff
-
- //tcase_add_test( tcase, test_NewASTNode_createFromToken );
+ tcase_add_test( tcase, test_NewASTNode_createFromToken );
tcase_add_test( tcase, test_NewASTNode_canonicalizeConstants );
tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctions );
tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctionsL1 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mh...@us...> - 2013-11-28 05:59:36
|
Revision: 19293
http://sourceforge.net/p/sbml/code/19293
Author: mhucka
Date: 2013-11-28 05:59:31 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
Added more comments and cleaned up a trivial thing or two.
Modified Paths:
--------------
trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java
Modified: trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java
===================================================================
--- trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java 2013-11-28 03:53:15 UTC (rev 19292)
+++ trunk/test-suite/src/front-ends/standalone/testsuite-ui/src/org/sbml/testsuite/ui/CasesArchiveManager.java 2013-11-28 05:59:31 UTC (rev 19293)
@@ -1,6 +1,6 @@
//
// @file CasesArchiveManager.java
-// @brief
+// @brief Class implementing unpacking, downloading and updating of test cases
// @author Michael Hucka
// @date 2013-11-21 <mh...@ca...>
//
@@ -34,46 +34,37 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Date;
import java.util.Vector;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.sbml.testsuite.core.CancelCallback;
import org.sbml.testsuite.core.UpdateCallback;
import org.sbml.testsuite.core.Util;
import org.w3c.dom.NodeList;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.net.MalformedURLException;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.wb.swt.SWTResourceManager;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.HttpURLConnection;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
/**
@@ -92,6 +83,13 @@
private StatusDialog currentDialog;
+ /**
+ * Internal specialized class for creating dialogs that are hooked into
+ * the processes later below. This can show either a regular progress
+ * bar or an indeterminate progress bar. When it is created, the dialog
+ * is not shown -- it is set to invisible. To show it, callers should
+ * call showAndWait().
+ */
class StatusDialog
extends Dialog
{
@@ -102,6 +100,11 @@
private Runnable cancelAction;
+ /**
+ * @param msg The initial message to show in the dialog
+ * @param infinite If true, show an indefinite progress bar
+ * @param showCancel A callback for the cancel action
+ */
public StatusDialog(String msg, boolean infinite, boolean showCancel)
{
super(parentShell, SWT.None);
@@ -110,7 +113,7 @@
/**
- * Create contents of the dialog.
+ * Creates the contents of the dialog.
*/
private void createDialog(String msg, boolean infinite, boolean showCancel)
{
@@ -160,12 +163,10 @@
fl.marginWidth = 1;
compBar.setLayout(fl);
- int flags = 0;
if (infinite)
- flags = SWT.INDETERMINATE;
+ progressBar = new CustomProgressBar(compBar, SWT.INDETERMINATE);
else
- flags = SWT.HORIZONTAL;
- progressBar = new CustomProgressBar(compBar, flags);
+ progressBar = new CustomProgressBar(compBar, SWT.HORIZONTAL);
progressBar.resetSteps();
Button cmdCancel = new Button(shell, SWT.NONE);
@@ -246,6 +247,11 @@
}
+ /**
+ * Resets the message in the dialog. This uses Display.asyncExec(...)
+ * so that the caller doesn't have to worry aobut wrapping this
+ * appropriately.
+ */
public void setMessage(final String msg)
{
if (shell.isDisposed()) return;
@@ -262,6 +268,12 @@
}
+ /**
+ * Shows the dialog and enter a read-dispatch loop until the dialog
+ * is disposed. This is meant to be invoked after the caller starts
+ * a thread to do whatever work is needed. The thread should call
+ * the close() method on the dialog when the work is finished.
+ */
public void showAndWait()
{
if (shell.isDisposed() || parentShell.isDisposed())
@@ -278,6 +290,12 @@
}
+ /**
+ * Closes the dialog. The operation uses Display.syncExec(...) so that
+ * callers don't need to worry about wrapping the call in the usual
+ * scaffolding. The use of syncExec(...) is deliberate so that this
+ * method doesn't return until the close is actually done.
+ */
public void close()
{
if (shell.isDisposed()) return;
@@ -285,7 +303,8 @@
// If this close came as part of a cancel action, the cancel
// action would have been performed first. However, if this
// close() is called as part of the shell close listeners, then
- // we don't want to invoke the cancel action.
+ // we don't want to invoke the cancel action. Otherwise, doing
+ // so can cause the wrong dialog to be closed.
cancelAction = null;
// Note: syncExec, not asyncExec, so this method doesn't return
@@ -302,6 +321,9 @@
}
+ /**
+ * Constructor for the class.
+ */
public CasesArchiveManager(Shell parent)
{
parentShell = parent;
@@ -309,12 +331,23 @@
}
+ /**
+ * Returns the directory that contains the semantic test cases on the
+ * user's computer.
+ */
public File getInternalCasesDir()
{
return new File(Util.getInternalTestSuiteDir(), "/cases/semantic/");
}
+ /**
+ * Reads the date stamp file in the test case directory and returns either
+ * a Date object corresponding to that date, or null if it could not find
+ * the date file or something went wrong while trying to read it.
+ *
+ * This method will bring up dialogs and tell the user if problems arise.
+ */
public Date getInternalCasesDate()
{
try
@@ -354,6 +387,12 @@
}
+ /**
+ * Extract the archive of test cases that is bundled in the resources
+ * directory of our application jar file.
+ *
+ * This method will bring up dialogs and tell the user if problems arise.
+ */
public void extractInternalCasesArchive()
{
File destDir = new File(Util.getUserDir());
@@ -404,6 +443,10 @@
}
+ /**
+ * Runnable to be run as a subthread to unpack an archive file. This is
+ * invoked by unpackArchive(...).
+ */
class UnpackHandler
implements Runnable
{
@@ -421,6 +464,8 @@
@Override
public void run()
{
+ // Note: this is the callback for the call to Util.unzipArchive(),
+ // not the callback for the status dialog.
CancelCallback cancelCallback = new CancelCallback() {
public boolean cancellationRequested()
{
@@ -430,6 +475,8 @@
if (!Util.unzipArchive(file, cancelCallback) && !cancelled.get())
{
+ // We failed to unzip the archive but we didn't get cancelled
+ // by the user, which means something went wrong.
success.set(false);
currentDialog.close();
display.syncExec(new Runnable() {
@@ -447,6 +494,8 @@
return;
}
+ // If we get here, we think we unzip'ed the archive. Do a few
+ // more sanity checks.
File casesDir = getInternalCasesDir();
if (casesDir.isDirectory())
{
@@ -473,6 +522,10 @@
}
+ /**
+ * Unpack the archive pointed to by @p file, which is assumed to be a
+ * zip archive of SBML Test Suite test cases.
+ */
public boolean unpackArchive(File file)
{
currentDialog = new StatusDialog("Unpacking test case archive...",
@@ -506,6 +559,10 @@
}
+ /**
+ * Runnable used to check sf.net for the latest test case archive. This
+ * is called by checkForUpdates(...).
+ */
class ServerCheckHandler
implements Runnable
{
@@ -524,6 +581,8 @@
if (connection == null || rssContents == null)
{
+ // If we were running interactively, then tell the user
+ // we failed.
if (currentDialog != null)
{
currentDialog.close();
@@ -550,6 +609,7 @@
Vector<String> archives
= Util.getCaseArchiveURLs(rssContents, internalCasesDate);
+ // We're only interested in the latest archive.
if (archives != null && archives.size() > 0)
updatedArchiveURL = archives.firstElement();
@@ -606,6 +666,12 @@
}
+ /**
+ * Runnable used to download an archive over the network. Called by
+ * updateFromNetwork(...). This also assumes that updateFromNetwork()
+ * sets up the initial dialog, including setting the type (either normal
+ * or indeterminate).
+ */
class DownloadHandler
implements Runnable
{
@@ -638,6 +704,7 @@
boolean success = true;
if (size > 0)
{
+ // Callback to update the progress bar.
final UpdateCallback updateCallback = new UpdateCallback() {
public void update()
{
@@ -652,12 +719,17 @@
}
else
{
+ // We didn't get the size of the archive, so there's no need
+ // for an update callback.
success = Util.downloadUrlToStream(sourceURL, outputStream,
cancelCallback, null);
}
if (currentDialog != null) currentDialog.close();
if (!success && !cancelled.get())
{
+ // We failed for some reason. While not strictly equivalent
+ // to having been cancelled, we set the cancelled flag anyway
+ // so that the caller knows not to proceed further.
cancelled.set(true);
display.asyncExec(new Runnable() {
@Override
@@ -676,6 +748,12 @@
}
+ /**
+ * Method that handles downloading and unpacking an archive over the net.
+ * This assumes that the archive URL (= updatedArchiveURL) and a cache
+ * of the RSS feed (= rssContents) have already been set by the time this
+ * method is called.
+ */
public void updateFromNetwork()
{
if (updatedArchiveURL == null || rssContents == null) return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2013-11-28 03:53:19
|
Revision: 19292
http://sourceforge.net/p/sbml/code/19292
Author: luciansmith
Date: 2013-11-28 03:53:15 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
* Added ability to create ModelDefinitions in C.
* Added missing SubstanceConversionFactor functions for C.
* Added tests for all SBML-derived objects in Comp. Which caused me to notice the above missing functions.
Modified Paths:
--------------
trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.cpp
trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.h
trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.h
Added Paths:
-----------
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestModelDefinition.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedBy.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedElement.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSBaseRef.c
trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSubmodel.c
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-28 03:47:02 UTC (rev 19291)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.cpp 2013-11-28 03:53:15 UTC (rev 19292)
@@ -195,5 +195,41 @@
}
/** @endcond */
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion)
+{
+ return new ModelDefinition(level, version, pkgVersion);
+}
+
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ delete md;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * md)
+{
+ if (md != NULL)
+ {
+ return static_cast<ModelDefinition_t*>(md->clone());
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
LIBSBML_CPP_NAMESPACE_END
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.h
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-28 03:47:02 UTC (rev 19291)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/ModelDefinition.h 2013-11-28 03:53:15 UTC (rev 19292)
@@ -196,7 +196,23 @@
//
// C API will be added here.
//
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_create(unsigned int level, unsigned int version,
+ unsigned int pkgVersion);
+LIBSBML_EXTERN
+void
+ModelDefinition_free(ModelDefinition_t * emd);
+
+
+LIBSBML_EXTERN
+ModelDefinition_t *
+ModelDefinition_clone(ModelDefinition_t * emd);
+
+
+
+
END_C_DECLS
LIBSBML_CPP_NAMESPACE_END
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-28 03:47:02 UTC (rev 19291)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2013-11-28 03:53:15 UTC (rev 19292)
@@ -1438,6 +1438,20 @@
*/
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s)
+{
+ if (s == NULL)
+ return NULL;
+
+ return s->getSubstanceConversionFactor().empty() ? NULL : safe_strdup(s->getSubstanceConversionFactor().c_str());
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s)
{
if (s == NULL)
@@ -1499,6 +1513,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? static_cast<int>(s->isSetSubstanceConversionFactor()) : 0;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? static_cast<int>(s->isSetTimeConversionFactor()) : 0;
@@ -1554,6 +1579,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor)
+{
+ return (s != NULL) ? s->setSubstanceConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor)
{
return (s != NULL) ? s->setTimeConversionFactor(timeConversionFactor) : LIBSBML_INVALID_OBJECT;
@@ -1609,6 +1645,17 @@
*/
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s)
+{
+ return (s != NULL) ? s->unsetSubstanceConversionFactor() : LIBSBML_INVALID_OBJECT;
+}
+
+
+/**
+ *
+ */
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s)
{
return (s != NULL) ? s->unsetTimeConversionFactor() : LIBSBML_INVALID_OBJECT;
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.h
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.h 2013-11-28 03:47:02 UTC (rev 19291)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.h 2013-11-28 03:53:15 UTC (rev 19292)
@@ -879,6 +879,11 @@
LIBSBML_EXTERN
char *
+Submodel_getSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+char *
Submodel_getTimeConversionFactor(Submodel_t * s);
@@ -904,6 +909,11 @@
LIBSBML_EXTERN
int
+Submodel_isSetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_isSetTimeConversionFactor(Submodel_t * s);
@@ -929,6 +939,11 @@
LIBSBML_EXTERN
int
+Submodel_setSubstanceConversionFactor(Submodel_t * s, const char * timeConversionFactor);
+
+
+LIBSBML_EXTERN
+int
Submodel_setTimeConversionFactor(Submodel_t * s, const char * timeConversionFactor);
@@ -954,6 +969,11 @@
LIBSBML_EXTERN
int
+Submodel_unsetSubstanceConversionFactor(Submodel_t * s);
+
+
+LIBSBML_EXTERN
+int
Submodel_unsetTimeConversionFactor(Submodel_t * s);
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestDeletion.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,191 @@
+/**
+ * \file TestDeletion.c
+ * \brief Deletion unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/Deletion.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static Deletion_t *P;
+
+
+void
+DeletionTest_setup (void)
+{
+ P = Deletion_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("Deletion_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+DeletionTest_teardown (void)
+{
+ Deletion_free(P);
+}
+
+
+START_TEST (test_comp_deletion_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_DELETION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( Deletion_getId (P) == NULL );
+ fail_unless( Deletion_getName (P) == NULL );
+
+ fail_unless( !Deletion_isSetId (P) );
+ fail_unless( !Deletion_isSetName (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_free_NULL)
+{
+ Deletion_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ Deletion_setId(P, id);
+
+ fail_unless( !strcmp(Deletion_getId(P), id) );
+ fail_unless( Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) == id)
+ {
+ fail("Deletion_setId(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetId(P);
+
+ fail_unless( !Deletion_isSetId(P) );
+
+ if (Deletion_getId(P) != NULL)
+ {
+ fail("Deletion_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ Deletion_setName(P, name);
+
+ fail_unless( !strcmp(Deletion_getName(P), name) );
+ fail_unless( Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) == name)
+ {
+ fail("Deletion_setName(...) did not make a copy of string.");
+ }
+
+ Deletion_unsetName(P);
+
+ fail_unless( !Deletion_isSetName(P) );
+
+ if (Deletion_getName(P) != NULL)
+ {
+ fail("Deletion_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_deletion_hasRequiredAttributes )
+{
+ Deletion_t *P = Deletion_create (3, 1, 1);
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ Deletion_setId(P, "p");
+
+ fail_unless ( !Deletion_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( Deletion_hasRequiredAttributes(P));
+
+ Deletion_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_Deletion (void)
+{
+ Suite *suite = suite_create("comp_deletion");
+ TCase *tcase = tcase_create("comp_deletion");
+
+
+ tcase_add_checked_fixture( tcase,
+ DeletionTest_setup,
+ DeletionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_deletion_create );
+ tcase_add_test( tcase, test_comp_deletion_free_NULL );
+ tcase_add_test( tcase, test_comp_deletion_id );
+ tcase_add_test( tcase, test_comp_deletion_name );
+ tcase_add_test( tcase, test_comp_deletion_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestExternalModelDefinition.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,255 @@
+/**
+ * \file TestExternalModelDefinition.c
+ * \brief ExternalModelDefinition unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ExternalModelDefinition.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ExternalModelDefinition_t *P;
+
+
+void
+ExternalModelDefinitionTest_setup (void)
+{
+ P = ExternalModelDefinition_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ExternalModelDefinition_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ExternalModelDefinitionTest_teardown (void)
+{
+ ExternalModelDefinition_free(P);
+}
+
+
+START_TEST (test_comp_externalModelDefinition_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_EXTERNALMODELDEFINITION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ExternalModelDefinition_getId (P) == NULL );
+ fail_unless( ExternalModelDefinition_getName (P) == NULL );
+ fail_unless( ExternalModelDefinition_getModelRef (P) == NULL );
+ fail_unless( ExternalModelDefinition_getSource (P) == NULL );
+
+ fail_unless( !ExternalModelDefinition_isSetId (P) );
+ fail_unless( !ExternalModelDefinition_isSetName (P) );
+ fail_unless( !ExternalModelDefinition_isSetModelRef (P) );
+ fail_unless( !ExternalModelDefinition_isSetSource (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_free_NULL)
+{
+ ExternalModelDefinition_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ ExternalModelDefinition_setId(P, id);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getId(P), id) );
+ fail_unless( ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_getId(P) == id)
+ {
+ fail("ExternalModelDefinition_setId(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetId(P);
+
+ fail_unless( !ExternalModelDefinition_isSetId(P) );
+
+ if (ExternalModelDefinition_getId(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetName(P) );
+
+ ExternalModelDefinition_setName(P, name);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getName(P), name) );
+ fail_unless( ExternalModelDefinition_isSetName(P) );
+
+ if (ExternalModelDefinition_getName(P) == name)
+ {
+ fail("ExternalModelDefinition_setName(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetName(P);
+
+ fail_unless( !ExternalModelDefinition_isSetName(P) );
+
+ if (ExternalModelDefinition_getName(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_modelRef)
+{
+ const char *modelRef = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetModelRef(P) );
+
+ ExternalModelDefinition_setModelRef(P, modelRef);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getModelRef(P), modelRef) );
+ fail_unless( ExternalModelDefinition_isSetModelRef(P) );
+
+ if (ExternalModelDefinition_getModelRef(P) == modelRef)
+ {
+ fail("ExternalModelDefinition_setModelRef(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetModelRef(P);
+
+ fail_unless( !ExternalModelDefinition_isSetModelRef(P) );
+
+ if (ExternalModelDefinition_getModelRef(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetModelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_source)
+{
+ const char *source = "My_Favorite_Factory";
+
+
+ fail_unless( !ExternalModelDefinition_isSetSource(P) );
+
+ ExternalModelDefinition_setSource(P, source);
+
+ fail_unless( !strcmp(ExternalModelDefinition_getSource(P), source) );
+ fail_unless( ExternalModelDefinition_isSetSource(P) );
+
+ if (ExternalModelDefinition_getSource(P) == source)
+ {
+ fail("ExternalModelDefinition_setSource(...) did not make a copy of string.");
+ }
+
+ ExternalModelDefinition_unsetSource(P);
+
+ fail_unless( !ExternalModelDefinition_isSetSource(P) );
+
+ if (ExternalModelDefinition_getSource(P) != NULL)
+ {
+ fail("ExternalModelDefinition_unsetSource(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_externalModelDefinition_hasRequiredAttributes )
+{
+ ExternalModelDefinition_t *P = ExternalModelDefinition_create (3, 1, 1);
+
+ fail_unless ( !ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_setId(P, "p");
+
+ fail_unless ( !ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_setSource(P, "http://here.com/it/is");
+
+ fail_unless ( ExternalModelDefinition_hasRequiredAttributes(P));
+
+ ExternalModelDefinition_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ExternalModelDefinition (void)
+{
+ Suite *suite = suite_create("comp_externalModelDefinition");
+ TCase *tcase = tcase_create("comp_externalModelDefinition");
+
+
+ tcase_add_checked_fixture( tcase,
+ ExternalModelDefinitionTest_setup,
+ ExternalModelDefinitionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_externalModelDefinition_create );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_free_NULL );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_id );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_name );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_modelRef );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_source );
+ tcase_add_test( tcase, test_comp_externalModelDefinition_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestModelDefinition.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestModelDefinition.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestModelDefinition.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,166 @@
+/**
+ * \file TestModelDefinition.c
+ * \brief ModelDefinition unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ModelDefinition.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ModelDefinition_t *P;
+
+
+void
+ModelDefinitionTest_setup (void)
+{
+ P = ModelDefinition_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ModelDefinition_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ModelDefinitionTest_teardown (void)
+{
+ ModelDefinition_free(P);
+}
+
+
+START_TEST (test_comp_modelDefinition_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_MODELDEFINITION );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_free_NULL)
+{
+ ModelDefinition_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Model_isSetId(P) );
+
+ Model_setId(P, id);
+
+ fail_unless( !strcmp(Model_getId(P), id) );
+ fail_unless( Model_isSetId(P) );
+
+ if (Model_getId(P) == id)
+ {
+ fail("Model_setId(...) did not make a copy of string.");
+ }
+
+ Model_unsetId(P);
+
+ fail_unless( !Model_isSetId(P) );
+
+ if (Model_getId(P) != NULL)
+ {
+ fail("Model_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_modelDefinition_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Model_isSetName(P) );
+
+ Model_setName(P, name);
+
+ fail_unless( !strcmp(Model_getName(P), name) );
+ fail_unless( Model_isSetName(P) );
+
+ if (Model_getName(P) == name)
+ {
+ fail("Model_setName(...) did not make a copy of string.");
+ }
+
+ Model_unsetName(P);
+
+ fail_unless( !Model_isSetName(P) );
+
+ if (Model_getName(P) != NULL)
+ {
+ fail("Model_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ModelDefinition (void)
+{
+ Suite *suite = suite_create("comp_modelDefinition");
+ TCase *tcase = tcase_create("comp_modelDefinition");
+
+
+ tcase_add_checked_fixture( tcase,
+ ModelDefinitionTest_setup,
+ ModelDefinitionTest_teardown );
+
+ tcase_add_test( tcase, test_comp_modelDefinition_create );
+ tcase_add_test( tcase, test_comp_modelDefinition_free_NULL );
+ tcase_add_test( tcase, test_comp_modelDefinition_id );
+ tcase_add_test( tcase, test_comp_modelDefinition_name );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedBy.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedBy.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedBy.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,159 @@
+/**
+ * \file TestReplacedBy.c
+ * \brief ReplacedBy unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ReplacedBy.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ReplacedBy_t *P;
+
+
+void
+ReplacedByTest_setup (void)
+{
+ P = ReplacedBy_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ReplacedBy_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ReplacedByTest_teardown (void)
+{
+ ReplacedBy_free(P);
+}
+
+
+START_TEST (test_comp_replacedBy_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_REPLACEDBY );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ReplacedBy_getSubmodelRef (P) == NULL );
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_free_NULL)
+{
+ ReplacedBy_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_submodelRef)
+{
+ const char *submodelRef = "mitochondria";
+
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef(P) );
+
+ ReplacedBy_setSubmodelRef(P, submodelRef);
+
+ fail_unless( !strcmp(ReplacedBy_getSubmodelRef(P), submodelRef) );
+ fail_unless( ReplacedBy_isSetSubmodelRef(P) );
+
+ if (ReplacedBy_getSubmodelRef(P) == submodelRef)
+ {
+ fail("ReplacedBy_setSubmodelRef(...) submodelRef not make a copy of string.");
+ }
+
+ ReplacedBy_unsetSubmodelRef(P);
+
+ fail_unless( !ReplacedBy_isSetSubmodelRef(P) );
+
+ if (ReplacedBy_getSubmodelRef(P) != NULL)
+ {
+ fail("ReplacedBy_unsetSubmodelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedBy_hasRequiredAttributes )
+{
+ ReplacedBy_t *P = ReplacedBy_create (3, 1, 1);
+
+ fail_unless ( !ReplacedBy_hasRequiredAttributes(P));
+
+ ReplacedBy_setSubmodelRef(P, "p");
+
+ fail_unless ( !ReplacedBy_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( ReplacedBy_hasRequiredAttributes(P));
+
+ ReplacedBy_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ReplacedBy (void)
+{
+ Suite *suite = suite_create("comp_replacedBy");
+ TCase *tcase = tcase_create("comp_replacedBy");
+
+
+ tcase_add_checked_fixture( tcase,
+ ReplacedByTest_setup,
+ ReplacedByTest_teardown );
+
+ tcase_add_test( tcase, test_comp_replacedBy_create );
+ tcase_add_test( tcase, test_comp_replacedBy_free_NULL );
+ tcase_add_test( tcase, test_comp_replacedBy_submodelRef );
+ tcase_add_test( tcase, test_comp_replacedBy_hasRequiredAttributes);
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedElement.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedElement.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestReplacedElement.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,223 @@
+/**
+ * \file TestReplacedElement.c
+ * \brief ReplacedElement unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/ReplacedElement.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static ReplacedElement_t *P;
+
+
+void
+ReplacedElementTest_setup (void)
+{
+ P = ReplacedElement_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("ReplacedElement_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+ReplacedElementTest_teardown (void)
+{
+ ReplacedElement_free(P);
+}
+
+
+START_TEST (test_comp_replacedElement_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_REPLACEDELEMENT );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( ReplacedElement_getSubmodelRef (P) == NULL );
+ fail_unless( ReplacedElement_getDeletion (P) == NULL );
+ fail_unless( ReplacedElement_getConversionFactor (P) == NULL );
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef (P) );
+ fail_unless( !ReplacedElement_isSetDeletion (P) );
+ fail_unless( !ReplacedElement_isSetConversionFactor (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_free_NULL)
+{
+ ReplacedElement_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_submodelRef)
+{
+ const char *submodelRef = "mitochondria";
+
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef(P) );
+
+ ReplacedElement_setSubmodelRef(P, submodelRef);
+
+ fail_unless( !strcmp(ReplacedElement_getSubmodelRef(P), submodelRef) );
+ fail_unless( ReplacedElement_isSetSubmodelRef(P) );
+
+ if (ReplacedElement_getSubmodelRef(P) == submodelRef)
+ {
+ fail("ReplacedElement_setSubmodelRef(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetSubmodelRef(P);
+
+ fail_unless( !ReplacedElement_isSetSubmodelRef(P) );
+
+ if (ReplacedElement_getSubmodelRef(P) != NULL)
+ {
+ fail("ReplacedElement_unsetSubmodelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_deletion)
+{
+ const char *deletion = "My_Favorite_Factory";
+
+
+ fail_unless( !ReplacedElement_isSetDeletion(P) );
+
+ ReplacedElement_setDeletion(P, deletion);
+
+ fail_unless( !strcmp(ReplacedElement_getDeletion(P), deletion) );
+ fail_unless( ReplacedElement_isSetDeletion(P) );
+
+ if (ReplacedElement_getDeletion(P) == deletion)
+ {
+ fail("ReplacedElement_setDeletion(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetDeletion(P);
+
+ fail_unless( !ReplacedElement_isSetDeletion(P) );
+
+ if (ReplacedElement_getDeletion(P) != NULL)
+ {
+ fail("ReplacedElement_unsetDeletion(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_conversionFactor)
+{
+ const char *conversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !ReplacedElement_isSetConversionFactor(P) );
+
+ ReplacedElement_setConversionFactor(P, conversionFactor);
+
+ fail_unless( !strcmp(ReplacedElement_getConversionFactor(P), conversionFactor) );
+ fail_unless( ReplacedElement_isSetConversionFactor(P) );
+
+ if (ReplacedElement_getConversionFactor(P) == conversionFactor)
+ {
+ fail("ReplacedElement_setConversionFactor(...) did not make a copy of string.");
+ }
+
+ ReplacedElement_unsetConversionFactor(P);
+
+ fail_unless( !ReplacedElement_isSetConversionFactor(P) );
+
+ if (ReplacedElement_getConversionFactor(P) != NULL)
+ {
+ fail("ReplacedElement_unsetConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_replacedElement_hasRequiredAttributes )
+{
+ ReplacedElement_t *P = ReplacedElement_create (3, 1, 1);
+
+ fail_unless ( !ReplacedElement_hasRequiredAttributes(P));
+
+ ReplacedElement_setSubmodelRef(P, "p");
+
+ fail_unless ( !ReplacedElement_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( ReplacedElement_hasRequiredAttributes(P));
+
+ ReplacedElement_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_ReplacedElement (void)
+{
+ Suite *suite = suite_create("comp_replacedElement");
+ TCase *tcase = tcase_create("comp_replacedElement");
+
+
+ tcase_add_checked_fixture( tcase,
+ ReplacedElementTest_setup,
+ ReplacedElementTest_teardown );
+
+ tcase_add_test( tcase, test_comp_replacedElement_create );
+ tcase_add_test( tcase, test_comp_replacedElement_free_NULL );
+ tcase_add_test( tcase, test_comp_replacedElement_submodelRef );
+ tcase_add_test( tcase, test_comp_replacedElement_deletion );
+ tcase_add_test( tcase, test_comp_replacedElement_conversionFactor );
+ tcase_add_test( tcase, test_comp_replacedElement_hasRequiredAttributes);
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSBaseRef.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSBaseRef.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSBaseRef.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,299 @@
+/**
+ * \file TestSBaseRef.c
+ * \brief SBaseRef unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/SBaseRef.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static SBaseRef_t *P;
+
+
+void
+SBaseRefTest_setup (void)
+{
+ P = SBaseRef_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("SBaseRef_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+SBaseRefTest_teardown (void)
+{
+ SBaseRef_free(P);
+}
+
+
+START_TEST (test_comp_sBaseRef_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_SBASEREF );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( SBaseRef_getIdRef (P) == NULL );
+ fail_unless( SBaseRef_getUnitRef (P) == NULL );
+ fail_unless( SBaseRef_getMetaIdRef (P) == NULL );
+ fail_unless( SBaseRef_getPortRef (P) == NULL );
+ fail_unless( SBaseRef_getSBaseRef (P) == NULL );
+
+ fail_unless( !SBaseRef_isSetIdRef (P) );
+ fail_unless( !SBaseRef_isSetUnitRef (P) );
+ fail_unless( !SBaseRef_isSetMetaIdRef (P) );
+ fail_unless( !SBaseRef_isSetPortRef (P) );
+ fail_unless( !SBaseRef_isSetSBaseRef (P) );
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_free_NULL)
+{
+ SBaseRef_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_idRef)
+{
+ const char *idRef = "mitochondria";
+
+
+ fail_unless( !SBaseRef_isSetIdRef(P) );
+
+ SBaseRef_setIdRef(P, idRef);
+
+ fail_unless( !strcmp(SBaseRef_getIdRef(P), idRef) );
+ fail_unless( SBaseRef_isSetIdRef(P) );
+
+ if (SBaseRef_getIdRef(P) == idRef)
+ {
+ fail("SBaseRef_setIdRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetIdRef(P);
+
+ fail_unless( !SBaseRef_isSetIdRef(P) );
+
+ if (SBaseRef_getIdRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetIdRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_unitRef)
+{
+ const char *unitRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetUnitRef(P) );
+
+ SBaseRef_setUnitRef(P, unitRef);
+
+ fail_unless( !strcmp(SBaseRef_getUnitRef(P), unitRef) );
+ fail_unless( SBaseRef_isSetUnitRef(P) );
+
+ if (SBaseRef_getUnitRef(P) == unitRef)
+ {
+ fail("SBaseRef_setUnitRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetUnitRef(P);
+
+ fail_unless( !SBaseRef_isSetUnitRef(P) );
+
+ if (SBaseRef_getUnitRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetUnitRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_metaIdRef)
+{
+ const char *metaIdRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetMetaIdRef(P) );
+
+ SBaseRef_setMetaIdRef(P, metaIdRef);
+
+ fail_unless( !strcmp(SBaseRef_getMetaIdRef(P), metaIdRef) );
+ fail_unless( SBaseRef_isSetMetaIdRef(P) );
+
+ if (SBaseRef_getMetaIdRef(P) == metaIdRef)
+ {
+ fail("SBaseRef_setMetaIdRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetMetaIdRef(P);
+
+ fail_unless( !SBaseRef_isSetMetaIdRef(P) );
+
+ if (SBaseRef_getMetaIdRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetMetaIdRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_portRef)
+{
+ const char *portRef = "My_Favorite_Factory";
+
+
+ fail_unless( !SBaseRef_isSetPortRef(P) );
+
+ SBaseRef_setPortRef(P, portRef);
+
+ fail_unless( !strcmp(SBaseRef_getPortRef(P), portRef) );
+ fail_unless( SBaseRef_isSetPortRef(P) );
+
+ if (SBaseRef_getPortRef(P) == portRef)
+ {
+ fail("SBaseRef_setPortRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetPortRef(P);
+
+ fail_unless( !SBaseRef_isSetPortRef(P) );
+
+ if (SBaseRef_getPortRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetPortRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_sBaseRef)
+{
+ SBaseRef_t *sBaseRef = SBaseRef_create(3, 1, 1);
+
+ fail_unless( !SBaseRef_isSetSBaseRef(P) );
+
+ SBaseRef_setSBaseRef(P, sBaseRef);
+
+ fail_unless( SBaseRef_getSBaseRef(P) != NULL);
+ fail_unless( SBaseRef_isSetSBaseRef(P) );
+
+ if (SBaseRef_getSBaseRef(P) == sBaseRef)
+ {
+ fail("SBaseRef_setSBaseRef(...) did not make a copy of string.");
+ }
+
+ SBaseRef_unsetSBaseRef(P);
+
+ fail_unless( !SBaseRef_isSetSBaseRef(P) );
+
+ if (SBaseRef_getSBaseRef(P) != NULL)
+ {
+ fail("SBaseRef_unsetSBaseRef(P) did not clear string.");
+ }
+
+ SBaseRef_free(sBaseRef);
+}
+END_TEST
+
+
+START_TEST (test_comp_sBaseRef_hasRequiredAttributes )
+{
+ SBaseRef_t *P = SBaseRef_create (3, 1, 1);
+
+ fail_unless ( !SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetIdRef(P);
+ SBaseRef_setMetaIdRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetMetaIdRef(P);
+ SBaseRef_setUnitRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_unsetUnitRef(P);
+ SBaseRef_setPortRef(P, "p");
+
+ fail_unless ( SBaseRef_hasRequiredAttributes(P));
+
+ SBaseRef_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_SBaseRef (void)
+{
+ Suite *suite = suite_create("comp_sBaseRef");
+ TCase *tcase = tcase_create("comp_sBaseRef");
+
+
+ tcase_add_checked_fixture( tcase,
+ SBaseRefTest_setup,
+ SBaseRefTest_teardown );
+
+ tcase_add_test( tcase, test_comp_sBaseRef_create );
+ tcase_add_test( tcase, test_comp_sBaseRef_free_NULL );
+ tcase_add_test( tcase, test_comp_sBaseRef_idRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_unitRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_metaIdRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_portRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_sBaseRef );
+ tcase_add_test( tcase, test_comp_sBaseRef_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
Added: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSubmodel.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSubmodel.c (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestSubmodel.c 2013-11-28 03:53:15 UTC (rev 19292)
@@ -0,0 +1,359 @@
+/**
+ * \file TestSubmodel.c
+ * \brief Submodel unit tests
+ * \author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/sbml/Submodel.h>
+#include <sbml/packages/comp/extension/CompExtension.h>
+
+#include <sbml/SBMLDocument.h>
+
+#include <check.h>
+
+
+
+#include <sbml/common/extern.h>
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+BEGIN_C_DECLS
+
+static Submodel_t *P;
+
+
+void
+SubmodelTest_setup (void)
+{
+ P = Submodel_create(3, 1, 1);
+
+ if (P == NULL)
+ {
+ fail("Submodel_create(3, 1, 1) returned a NULL pointer.");
+ }
+}
+
+
+void
+SubmodelTest_teardown (void)
+{
+ Submodel_free(P);
+}
+
+
+START_TEST (test_comp_submodel_create)
+{
+ fail_unless( SBase_getTypeCode ((SBase_t *) P) == SBML_COMP_SUBMODEL );
+ fail_unless( SBase_getMetaId ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getNotes ((SBase_t *) P) == NULL );
+ fail_unless( SBase_getAnnotation((SBase_t *) P) == NULL );
+
+ fail_unless( Submodel_getId (P) == NULL );
+ fail_unless( Submodel_getName (P) == NULL );
+ fail_unless( Submodel_getModelRef (P) == NULL );
+ fail_unless( Submodel_getSubstanceConversionFactor (P) == NULL );
+ fail_unless( Submodel_getTimeConversionFactor (P) == NULL );
+ fail_unless( Submodel_getExtentConversionFactor (P) == NULL );
+ fail_unless( Submodel_getDeletion (P, 0) == NULL );
+
+ fail_unless( !Submodel_isSetId (P) );
+ fail_unless( !Submodel_isSetName (P) );
+ fail_unless( !Submodel_isSetModelRef (P) );
+ fail_unless( !Submodel_isSetSubstanceConversionFactor (P) );
+ fail_unless( !Submodel_isSetTimeConversionFactor (P) );
+ fail_unless( !Submodel_isSetExtentConversionFactor (P) );
+ fail_unless( !Submodel_getNumDeletions(P)==0 );
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_free_NULL)
+{
+ Submodel_free(NULL);
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_id)
+{
+ const char *id = "mitochondria";
+
+
+ fail_unless( !Submodel_isSetId(P) );
+
+ Submodel_setId(P, id);
+
+ fail_unless( !strcmp(Submodel_getId(P), id) );
+ fail_unless( Submodel_isSetId(P) );
+
+ if (Submodel_getId(P) == id)
+ {
+ fail("Submodel_setId(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetId(P);
+
+ fail_unless( !Submodel_isSetId(P) );
+
+ if (Submodel_getId(P) != NULL)
+ {
+ fail("Submodel_unsetId(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_name)
+{
+ const char *name = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetName(P) );
+
+ Submodel_setName(P, name);
+
+ fail_unless( !strcmp(Submodel_getName(P), name) );
+ fail_unless( Submodel_isSetName(P) );
+
+ if (Submodel_getName(P) == name)
+ {
+ fail("Submodel_setName(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetName(P);
+
+ fail_unless( !Submodel_isSetName(P) );
+
+ if (Submodel_getName(P) != NULL)
+ {
+ fail("Submodel_unsetName(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_modelRef)
+{
+ const char *modelRef = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetModelRef(P) );
+
+ Submodel_setModelRef(P, modelRef);
+
+ fail_unless( !strcmp(Submodel_getModelRef(P), modelRef) );
+ fail_unless( Submodel_isSetModelRef(P) );
+
+ if (Submodel_getModelRef(P) == modelRef)
+ {
+ fail("Submodel_setModelRef(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetModelRef(P);
+
+ fail_unless( !Submodel_isSetModelRef(P) );
+
+ if (Submodel_getModelRef(P) != NULL)
+ {
+ fail("Submodel_unsetModelRef(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_substanceConversionFactor)
+{
+ const char *substanceConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetSubstanceConversionFactor(P) );
+
+ Submodel_setSubstanceConversionFactor(P, substanceConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getSubstanceConversionFactor(P), substanceConversionFactor) );
+ fail_unless( Submodel_isSetSubstanceConversionFactor(P) );
+
+ if (Submodel_getSubstanceConversionFactor(P) == substanceConversionFactor)
+ {
+ fail("Submodel_setSubstanceConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetSubstanceConversionFactor(P);
+
+ fail_unless( !Submodel_isSetSubstanceConversionFactor(P) );
+
+ if (Submodel_getSubstanceConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetSubstanceConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_timeConversionFactor)
+{
+ const char *timeConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetTimeConversionFactor(P) );
+
+ Submodel_setTimeConversionFactor(P, timeConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getTimeConversionFactor(P), timeConversionFactor) );
+ fail_unless( Submodel_isSetTimeConversionFactor(P) );
+
+ if (Submodel_getTimeConversionFactor(P) == timeConversionFactor)
+ {
+ fail("Submodel_setTimeConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetTimeConversionFactor(P);
+
+ fail_unless( !Submodel_isSetTimeConversionFactor(P) );
+
+ if (Submodel_getTimeConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetTimeConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_extentConversionFactor)
+{
+ const char *extentConversionFactor = "My_Favorite_Factory";
+
+
+ fail_unless( !Submodel_isSetExtentConversionFactor(P) );
+
+ Submodel_setExtentConversionFactor(P, extentConversionFactor);
+
+ fail_unless( !strcmp(Submodel_getExtentConversionFactor(P), extentConversionFactor) );
+ fail_unless( Submodel_isSetExtentConversionFactor(P) );
+
+ if (Submodel_getExtentConversionFactor(P) == extentConversionFactor)
+ {
+ fail("Submodel_setExtentConversionFactor(...) did not make a copy of string.");
+ }
+
+ Submodel_unsetExtentConversionFactor(P);
+
+ fail_unless( !Submodel_isSetExtentConversionFactor(P) );
+
+ if (Submodel_getExtentConversionFactor(P) != NULL)
+ {
+ fail("Submodel_unsetExtentConversionFactor(P) did not clear string.");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_deletion)
+{
+ Deletion_t *deletion = Deletion_create(3, 1, 1);
+ const char* delname = "deletion";
+
+
+ fail_unless( Submodel_getNumDeletions(P) == 0 );
+
+ Submodel_addDeletion(P, deletion);
+
+ fail_unless( Submodel_getDeletion(P, 0) != NULL);
+ fail_unless( Submodel_getNumDeletions(P)==1 );
+
+ if (Submodel_getDeletion(P, 0) == deletion)
+ {
+ fail("Submodel_addDeletion(...) did not make a copy of the deletion.");
+ }
+
+ Submodel_removeDeletion(P, 0);
+
+ fail_unless( Submodel_getDeletion(P, 0) == NULL);
+ fail_unless( Submodel_getNumDeletions(P)==0 );
+
+ Deletion_setId(deletion, delname);
+
+ Submodel_addDeletion(P, deletion);
+ fail_unless( Submodel_getDeletionById(P, delname) != NULL);
+
+ Submodel_removeDeletionById(P, delname);
+ fail_unless( Submodel_getDeletionById(P, delname) == NULL);
+ fail_unless( Submodel_getNumDeletions(P)==0 );
+
+ Deletion_free(deletion);
+}
+END_TEST
+
+
+START_TEST (test_comp_submodel_hasRequiredAttributes )
+{
+ Submodel_t *P = Submodel_create (3, 1, 1);
+
+ fail_unless ( !Submodel_hasRequiredAttributes(P));
+
+ Submodel_setId(P, "p");
+
+ fail_unless ( !Submodel_hasRequiredAttributes(P));
+
+ SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
+
+ fail_unless ( Submodel_hasRequiredAttributes(P));
+
+ Submodel_free(P);
+}
+END_TEST
+
+
+Suite *
+create_suite_TestComp_Submodel (void)
+{
+ Suite *suite = suite_create("comp_submodel");
+ TCase *tcase = tcase_create("comp_submodel");
+
+
+ tcase_add_checked_fixture( tcase,
+ SubmodelTest_setup,
+ SubmodelTest_teardown );
+
+ tcase_add_test( tcase, test_comp_submodel_create );
+ tcase_add_test( tcase, test_comp_submodel_free_NULL );
+ tcase_add_test( tcase, test_comp_submodel_id );
+ tcase_add_test( tcase, test_comp_submodel_name );
+ tcase_add_test( tcase, test_comp_submodel_modelRef );
+ tcase_add_test( tcase, test_comp_submodel_substanceConversionFactor);
+ tcase_add_test( tcase, test_comp_submodel_timeConversionFactor );
+ tcase_add_test( tcase, test_comp_submodel_extentConversionFactor );
+ tcase_add_test( tcase, test_comp_submodel_deletion );
+ tcase_add_test( tcase, test_comp_submodel_hasRequiredAttributes );
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+END_C_DECLS
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2013-11-28 03:47:06
|
Revision: 19291
http://sourceforge.net/p/sbml/code/19291
Author: luciansmith
Date: 2013-11-28 03:47:02 +0000 (Thu, 28 Nov 2013)
Log Message:
-----------
The URI parser will convert \'s to /'s, so if we want to compare the two, we need to do the same. Not sure why this test didn't fail for others, unless it was only run on Mac/Linux? Or if the 'filename' was set by Frank by hand in CMake somewhere? Anyway, this fixes the problem so it doesn't matter.
Modified Paths:
--------------
trunk/libsbml/src/sbml/packages/comp/util/test/TestURIResolvers.cpp
Modified: trunk/libsbml/src/sbml/packages/comp/util/test/TestURIResolvers.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/TestURIResolvers.cpp 2013-11-27 16:01:54 UTC (rev 19290)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/TestURIResolvers.cpp 2013-11-28 03:47:02 UTC (rev 19291)
@@ -140,6 +140,11 @@
// testing odd schemes
string filename(TestDataDirectory);
+ size_t slash = filename.find('\\');
+ while (slash != string::npos) {
+ filename.replace(slash, 1, "/");
+ slash = filename.find('\\');
+ }
filename += "1090101-fail-01-04.xml";
uri = SBMLUri("1//jjj/lllkl:jjkj");
fail_unless(uri.getScheme() == "1//jjj/lllkl");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-27 16:01:56
|
Revision: 19290
http://sourceforge.net/p/sbml/code/19290
Author: sarahkeating
Date: 2013-11-27 16:01:54 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
put the canonicalize functions into my new ast class so that it will still work
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-27 14:07:03 UTC (rev 19289)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-27 16:01:54 UTC (rev 19290)
@@ -29,6 +29,7 @@
#include <sbml/math/NewASTNode.h>
#include <sbml/math/ASTCnIntegerNode.h>
#include <sbml/math/ASTPiecewiseFunctionNode.h>
+#include <sbml/util/IdList.h>
/** @cond doxygen-ignored */
@@ -42,6 +43,7 @@
ASTBase (type)
, mNumber ( NULL )
, mFunction ( NULL )
+ , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -85,6 +87,7 @@
ASTBase (number->getType())
, mNumber ( number )
, mFunction ( NULL )
+ , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -93,6 +96,7 @@
ASTBase (function->getType())
, mNumber ( NULL )
, mFunction ( function )
+ , mUserData ( NULL )
, mChar (0)
, mHistoricalName ("")
{
@@ -104,6 +108,7 @@
ASTBase(orig)
, mNumber ( NULL )
, mFunction ( NULL )
+ , mUserData ( orig.mUserData)
, mChar (orig.mChar)
, mHistoricalName (orig.mHistoricalName)
{
@@ -128,6 +133,7 @@
this->ASTBase::operator =(rhs);
mNumber = rhs.mNumber;
mFunction = rhs.mFunction;
+ mUserData = rhs.mUserData;
mChar = rhs.mChar;
mHistoricalName = rhs.mHistoricalName;
@@ -715,6 +721,7 @@
{
std::string name = "";
std::string url = "";
+ List * children = NULL;
if (mNumber != NULL)
{
name = mNumber->getName();
@@ -724,7 +731,16 @@
{
name = mFunction->getName();
url = mFunction->getDefinitionURL();
+ if (mFunction->getNumChildren() > 0)
+ {
+ children = new List();
+ for (unsigned int i = 0; i < mFunction->getNumChildren(); i++)
+ {
+ children->add(mFunction->getChild(0)->deepCopy());
+ }
+ }
}
+
reset(); // any children get deleted
// this looses information
if (representsNumber(type))
@@ -748,6 +764,13 @@
mFunction->setDefinitionURL(url);
ASTBase::setType(type);
mFunction->ASTBase::syncMembers(this);
+ if (children != NULL)
+ {
+ for (unsigned int i = 0; i < children->getSize(); i++)
+ {
+ mFunction->addChild((ASTBase*)(children->get(i)));
+ }
+ }
// keep a record of the character if the type is an operator
switch (type)
@@ -2324,6 +2347,488 @@
}
+bool
+NewASTNode::containsVariable(const std::string id) const
+{
+ bool found = false;
+
+ List * nodes = this->getListOfNodes( NewASTNode_isName );
+ unsigned int i = 0;
+ while (found == false && i < nodes->getSize())
+ {
+ NewASTNode* node = static_cast<NewASTNode*>( nodes->get(i) );
+ string name = node->getName() ? node->getName() : "";
+ if (name == id)
+ {
+ found = true;
+ }
+ i++;
+ }
+
+ return found;
+}
+
+
+unsigned int
+NewASTNode::getNumVariablesWithUndeclaredUnits(Model * m) const
+{
+ unsigned int number = 0;
+
+ if (m == NULL)
+ {
+ if (this->getParentSBMLObject() != NULL)
+ {
+ m = static_cast <Model *>(this->getParentSBMLObject()
+ ->getAncestorOfType(SBML_MODEL));
+ }
+ }
+
+ // we are possibly in a kineticLaw where parameters might
+ // have local ids
+ KineticLaw* kl = NULL;
+
+ if (this->getParentSBMLObject() != NULL &&
+ this->getParentSBMLObject()->getTypeCode() == SBML_KINETIC_LAW)
+ {
+ kl = static_cast<KineticLaw*>(this->getParentSBMLObject());
+ }
+
+ // create a list of variables in the math
+ List * nodes = this->getListOfNodes( NewASTNode_isName );
+ IdList * variables = new IdList();
+ for (unsigned int i = 0; i < nodes->getSize(); i++)
+ {
+ NewASTNode* node = static_cast<NewASTNode*>( nodes->get(i) );
+ string name = node->getName() ? node->getName() : "";
+ if (name.empty() == false)
+ {
+ if (variables->contains(name) == false)
+ {
+ variables->append(name);
+ }
+ }
+ }
+
+ if ( m == NULL)
+ {
+ // there is no model so we have no units
+ number = variables->size();
+ }
+ else
+ {
+ // should we look for reactions or speciesreferences in the math
+ bool allowReactionId = true;
+ bool allowSpeciesRef = false;
+
+ if ( (m->getLevel() < 2)
+ || ((m->getLevel() == 2) && (m->getVersion() == 1)) )
+ {
+ allowReactionId = false;
+ }
+
+ if (m->getLevel() > 2)
+ {
+ allowSpeciesRef = true;
+ }
+
+ // loop thru the list and check the unit status of each variable
+ for (unsigned int v = 0; v < variables->size(); v++)
+ {
+ string id = variables->at(v);
+
+
+ if (m->getParameter(id) != NULL)
+ {
+ if (m->getParameter(id)->isSetUnits() == false)
+ {
+ number++;
+ }
+ }
+ else if (m->getSpecies(id) != NULL)
+ {
+ if (m->getSpecies(id)->getDerivedUnitDefinition()->getNumUnits() == 0)
+ {
+ number++;
+ }
+ }
+ else if (m->getCompartment(id) != NULL)
+ {
+ if (m->getCompartment(id)->getDerivedUnitDefinition()
+ ->getNumUnits() == 0)
+ {
+ number++;
+ }
+ }
+ else if (kl != NULL && kl->getParameter(id) != NULL)
+ {
+ if (kl->getParameter(id)->getDerivedUnitDefinition() == NULL ||
+ kl->getParameter(id)->getDerivedUnitDefinition()->getNumUnits() == 0)
+ {
+ number++;
+ }
+ }
+ else if (allowReactionId == true
+ && m->getReaction(id) != NULL
+ && m->getReaction(id)->getKineticLaw() != NULL)
+ {
+ if (m->getReaction(id)->getKineticLaw()->getDerivedUnitDefinition()
+ ->getNumUnits() == 0)
+ {
+ number++;
+ }
+ }
+ /* actually these always are considered to be dimensionless */
+ //else if (allowSpeciesRef == true && m->getSpeciesReference(id) != NULL)
+ //{
+ //}
+ }
+ }
+
+ return number;
+}
+
+
+int
+NewASTNode::setUserData(void *userData)
+{
+ this->mUserData = userData;
+ if (mUserData != NULL)
+ {
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+ else
+ {
+ return LIBSBML_OPERATION_FAILED;
+ }
+}
+
+
+void *
+NewASTNode::getUserData() const
+{
+ return this->mUserData;
+}
+
+
+bool
+NewASTNode::canonicalize ()
+{
+ bool found = false;
+
+
+ if (mType == AST_NAME)
+ {
+ found = canonicalizeConstant();
+ }
+
+ if (!found && mType == AST_FUNCTION)
+ {
+ found = canonicalizeFunction();
+
+ if (!found)
+ {
+ found = canonicalizeLogical();
+ }
+
+ if (!found)
+ {
+ found = canonicalizeRelational();
+ }
+ }
+
+ return found;
+}
+
+/**
+ * String Constants
+ */
+static const char *AST_LAMBDA_STRING = "lambda";
+
+static const char *AST_CONSTANT_STRINGS[] =
+{
+ "exponentiale"
+ , "false"
+ , "pi"
+ , "true"
+};
+
+static const char *AST_FUNCTION_STRINGS[] =
+{
+ "abs"
+ , "arccos"
+ , "arccosh"
+ , "arccot"
+ , "arccoth"
+ , "arccsc"
+ , "arccsch"
+ , "arcsec"
+ , "arcsech"
+ , "arcsin"
+ , "arcsinh"
+ , "arctan"
+ , "arctanh"
+ , "ceiling"
+ , "cos"
+ , "cosh"
+ , "cot"
+ , "coth"
+ , "csc"
+ , "csch"
+ , "delay"
+ , "exp"
+ , "factorial"
+ , "floor"
+ , "ln"
+ , "log"
+ , "piecewise"
+ , "power"
+ , "root"
+ , "sec"
+ , "sech"
+ , "sin"
+ , "sinh"
+ , "tan"
+ , "tanh"
+};
+
+
+static const char *AST_LOGICAL_STRINGS[] =
+{
+ "and"
+ , "not"
+ , "or"
+ , "xor"
+};
+
+
+static const char *AST_RELATIONAL_STRINGS[] =
+{
+ "eq"
+ , "geq"
+ , "gt"
+ , "leq"
+ , "lt"
+ , "neq"
+};
+
+
+static const char *AST_OPERATOR_STRINGS[] =
+{
+ "divide"
+ , "minus"
+ , "plus"
+ , "times"
+ , "power"
+};
+
+
+
+bool
+NewASTNode::canonicalizeConstant ()
+{
+ const int first = AST_CONSTANT_E;
+ const int last = AST_CONSTANT_TRUE;
+ const int size = last - first + 1;
+
+ int index;
+ bool found;
+
+
+
+ index = util_bsearchStringsI(AST_CONSTANT_STRINGS, getName(), 0, size - 1);
+ found = (index < size);
+
+ if (found)
+ {
+ setType( static_cast<ASTNodeType_t>(first + index) );
+ }
+
+ return found;
+}
+
+
+bool
+NewASTNode::canonicalizeFunction ()
+{
+ const int first = AST_FUNCTION_ABS;
+ const int last = AST_FUNCTION_TANH;
+ const int size = last - first + 1;
+
+ int index;
+ bool found;
+
+
+ /**
+ * Search for SBML Level 1 function names first.
+ */
+ found = canonicalizeFunctionL1();
+
+ /**
+ * Now Lambda...
+ */
+ if (!found)
+ {
+ if ( (found = !strcmp_insensitive(getName(), AST_LAMBDA_STRING)) )
+ {
+ setType(AST_LAMBDA);
+ }
+ }
+
+ /**
+ * ... and finally the L2 (MathML) function names.
+ */
+ if (!found)
+ {
+ index = util_bsearchStringsI(AST_FUNCTION_STRINGS, getName(), 0, size - 1);
+ found = (index < size);
+
+ if (found)
+ {
+ setType( static_cast<ASTNodeType_t>(first + index) );
+ }
+ }
+
+ return found;
+}
+
+
+bool
+NewASTNode::canonicalizeFunctionL1 ()
+{
+ NewASTNode* child;
+
+
+ if ( !strcmp_insensitive(getName(), "acos") )
+ {
+ setType(AST_FUNCTION_ARCCOS);
+ }
+ else if ( !strcmp_insensitive(getName(), "asin") )
+ {
+ setType(AST_FUNCTION_ARCSIN);
+ }
+ else if ( !strcmp_insensitive(getName(), "atan") )
+ {
+ setType(AST_FUNCTION_ARCTAN);
+ }
+ else if ( !strcmp_insensitive(getName(), "ceil") )
+ {
+ setType(AST_FUNCTION_CEILING);
+ }
+
+ /**
+ * "log(x)" in L1 is represented as "ln(x)" in L2.
+ *
+ * Notice, however, that the conversion is performed only if the number of
+ * arguments is 1. Thus "log(5, x)" will still be "log(5, x) when passed
+ * through this filter.
+ */
+ else if ( !strcmp_insensitive(getName(), "log") && (getNumChildren() == 1) )
+ {
+ setType(AST_FUNCTION_LN);
+ }
+
+ /**
+ * "log10(x)" in L1 is represented as "log(10, x)" in L2.
+ */
+ else if ( !strcmp_insensitive(getName(), "log10") && (getNumChildren() == 1) )
+ {
+ setType(AST_FUNCTION_LOG);
+
+ child = new NewASTNode;
+ child->setValue(10);
+
+ prependChild(child);
+ }
+
+ /**
+ * Here we set the type to AST_FUNCTION_POWER. We could set it to
+ * AST_POWER, but then we would loose the idea that it was a function
+ * before it was canonicalized.
+ */
+ else if ( !strcmp_insensitive(getName(), "pow") )
+ {
+ setType(AST_FUNCTION_POWER);
+ }
+
+ /**
+ * "sqr(x)" in L1 is represented as "power(x, 2)" in L2.
+ */
+ else if ( !strcmp_insensitive(getName(), "sqr") && (getNumChildren() == 1) )
+ {
+ setType(AST_FUNCTION_POWER);
+
+ child = new NewASTNode;
+ child->setValue(2);
+
+ addChild(child);
+ }
+
+ /**
+ * "sqrt(x) in L1 is represented as "root(2, x)" in L1.
+ */
+ else if ( !strcmp_insensitive(getName(), "sqrt") && (getNumChildren() == 1) )
+ {
+ setType(AST_FUNCTION_ROOT);
+
+ child = new NewASTNode;
+ child->setValue(2);
+
+ prependChild(child);
+ }
+
+ /**
+ * Was a conversion performed?
+ */
+ return (mType != AST_FUNCTION);
+}
+
+
+bool
+NewASTNode::canonicalizeLogical ()
+{
+ const int first = AST_LOGICAL_AND;
+ const int last = AST_LOGICAL_XOR;
+ const int size = last - first + 1;
+
+ int index;
+ bool found;
+
+
+ index = util_bsearchStringsI(AST_LOGICAL_STRINGS, getName(), 0, size - 1);
+ found = (index < size);
+
+ if (found)
+ {
+ setType( static_cast<ASTNodeType_t>(first + index) );
+ }
+
+ return found;
+}
+
+
+
+bool
+NewASTNode::canonicalizeRelational ()
+{
+ const int first = AST_RELATIONAL_EQ;
+ const int last = AST_RELATIONAL_NEQ;
+ const int size = last - first + 1;
+
+ int index;
+ bool found;
+
+
+ index = util_bsearchStringsI(AST_RELATIONAL_STRINGS, getName(), 0, size - 1);
+ found = (index < size);
+
+ if (found)
+ {
+ setType( static_cast<ASTNodeType_t>(first + index) );
+ }
+
+ return found;
+}
+
void
NewASTNode::reset()
{
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 14:07:03 UTC (rev 19289)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 16:01:54 UTC (rev 19290)
@@ -239,7 +239,7 @@
* AST_INTEGER@endlink and a value of 2. The function names that result
* in structural changes are: @c log10, @c sqr, and @c sqrt.
*/
- // bool canonicalize ();
+ bool canonicalize ();
/**
@@ -1419,7 +1419,7 @@
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
* @li @link OperationReturnValues_t#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink
*/
-// int setUserData(void *userData);
+ int setUserData(void *userData);
/**
@@ -1431,7 +1431,7 @@
* @see ASTNode::setUserData
* @endif@~
*/
- // void *getUserData() const;
+ void *getUserData() const;
/**
@@ -1483,32 +1483,34 @@
virtual bool isQualifier() const;
+
protected:
/** @cond doxygen-libsbml-internal */
ASTNumber * mNumber;
ASTFunction * mFunction;
+ void *mUserData;
/* put this here for historical purposes */
char mChar;
std::string mHistoricalName;
- //bool containsVariable(const std::string id) const;
+ bool containsVariable(const std::string id) const;
- //unsigned int getNumVariablesWithUndeclaredUnits(Model * m = NULL) const;
+ unsigned int getNumVariablesWithUndeclaredUnits(Model * m = NULL) const;
friend class UnitFormulaFormatter;
/**
* Internal helper function for canonicalize().
*/
- //bool canonicalizeConstant ();
- //bool canonicalizeFunction ();
- //bool canonicalizeFunctionL1 ();
- //bool canonicalizeLogical ();
- //bool canonicalizeRelational ();
+ bool canonicalizeConstant ();
+ bool canonicalizeFunction ();
+ bool canonicalizeFunctionL1 ();
+ bool canonicalizeLogical ();
+ bool canonicalizeRelational ();
/* additional to original astnode */
bool hasCnUnits() const;
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 14:07:03 UTC (rev 19289)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 16:01:54 UTC (rev 19290)
@@ -97,7 +97,7 @@
// t = FormulaTokenizer_nextToken(ft);
// n = NewASTNode_createFromToken(t);
//
-// fail_unless( NewASTNode_getType(n) == AST_NAME );
+// fail_unless( NewASTNode_getType() == AST_NAME );
// fail_unless( !strcmp(NewASTNode_getName(n), "foo") );
// fail_unless( NewASTNode_getNumChildren(n) == 0 );
//
@@ -213,728 +213,729 @@
//END_TEST
//
//
-//START_TEST (test_NewASTNode_canonicalizeConstants)
-//{
-// NewASTNode_t *n = NewASTNode_create();
-//
-//
-// /** ExponentialE **/
-// NewASTNode_setName(n, "ExponentialE");
-// fail_unless( NewASTNode_isName(n));
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_CONSTANT_E );
-//
-// NewASTNode_setType(n, AST_NAME);
-//
-//
-// /** False **/
-// NewASTNode_setName(n, "False");
-// fail_unless( NewASTNode_isName(n));
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_CONSTANT_FALSE );
-//
-// NewASTNode_setType(n, AST_NAME);
-//
-//
-// /** Pi **/
-// NewASTNode_setName(n, "Pi");
-// fail_unless( NewASTNode_isName(n));
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_CONSTANT_PI );
-//
-// NewASTNode_setType(n, AST_NAME);
-//
-//
-// /** True **/
-// NewASTNode_setName(n, "True");
-// fail_unless( NewASTNode_isName(n));
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_CONSTANT_TRUE );
-//
-// NewASTNode_setType(n, AST_NAME);
-//
-//
-// /** Foo **/
-// NewASTNode_setName(n, "Foo");
-// fail_unless( NewASTNode_isName(n));
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_isName(n));
-//
-//
-// delete n;
-//}
-//END_TEST
-//
-//
-//START_TEST (test_NewASTNode_canonicalizeFunctions)
-//{
-// NewASTNode_t *n = NewASTNode_createWithType(AST_FUNCTION);
-//
-//
-// /** abs **/
-// NewASTNode_setName(n, "abs");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ABS );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccos **/
-// NewASTNode_setName(n, "arccos");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCOS );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccosh **/
-// NewASTNode_setName(n, "arccosh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCOSH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccot **/
-// NewASTNode_setName(n, "arccot");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCOT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccoth **/
-// NewASTNode_setName(n, "arccoth");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCOTH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccsc **/
-// NewASTNode_setName(n, "arccsc");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCSC );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arccsch **/
-// NewASTNode_setName(n, "arccsch");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCSCH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arcsec **/
-// NewASTNode_setName(n, "arcsec");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCSEC );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arcsech **/
-// NewASTNode_setName(n, "arcsech");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCSECH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arcsin **/
-// NewASTNode_setName(n, "arcsin");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCSIN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arcsinh **/
-// NewASTNode_setName(n, "arcsinh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCSINH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arctan **/
-// NewASTNode_setName(n, "arctan");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCTAN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** arctanh **/
-// NewASTNode_setName(n, "arctanh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCTANH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** ceiling **/
-// NewASTNode_setName(n, "ceiling");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_CEILING );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** cos **/
-// NewASTNode_setName(n, "cos");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_COS );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** cosh **/
-// NewASTNode_setName(n, "cosh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_COSH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** cot **/
-// NewASTNode_setName(n, "cot");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_COT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** coth **/
-// NewASTNode_setName(n, "coth");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_COTH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** csc **/
-// NewASTNode_setName(n, "csc");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_CSC );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** csch **/
-// NewASTNode_setName(n, "csch");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_CSCH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** exp **/
-// NewASTNode_setName(n, "exp");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_EXP );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** factorial **/
-// NewASTNode_setName(n, "factorial");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_FACTORIAL );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** floor **/
-// NewASTNode_setName(n, "floor");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_FLOOR );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** lambda **/
-// NewASTNode_setName(n, "lambda");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_LAMBDA );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** ln **/
-// NewASTNode_setName(n, "ln");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_LN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** log **/
-// NewASTNode_setName(n, "log");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_LOG );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** piecewise **/
-// NewASTNode_setName(n, "piecewise");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_PIECEWISE );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** power **/
-// NewASTNode_setName(n, "power");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_POWER );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** root **/
-// NewASTNode_setName(n, "root");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ROOT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** sec **/
-// NewASTNode_setName(n, "sec");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_SEC );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** sech **/
-// NewASTNode_setName(n, "sech");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_SECH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** sin **/
-// NewASTNode_setName(n, "sin");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_SIN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** sinh **/
-// NewASTNode_setName(n, "sinh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_SINH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** tan **/
-// NewASTNode_setName(n, "tan");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_TAN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** tanh **/
-// NewASTNode_setName(n, "tanh");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_TANH );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** Foo **/
-// NewASTNode_setName(n, "Foo");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION);
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-//
-// delete n;
-//}
-//END_TEST
-//
-//
-//START_TEST (test_NewASTNode_canonicalizeFunctionsL1)
-//{
-// NewASTNode_t *n = NewASTNode_createWithType(AST_FUNCTION);
-// NewASTNode_t *c;
-//
-//
-// /** acos **/
-// NewASTNode_setName(n, "acos");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCCOS );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** asin **/
-// NewASTNode_setName(n, "asin");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCSIN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** atan **/
-// NewASTNode_setName(n, "atan");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ARCTAN );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** ceil **/
-// NewASTNode_setName(n, "ceil");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_CEILING );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-// /** pow **/
-// NewASTNode_setName(n, "pow");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_POWER );
-//
-// delete n;
-//
-// /**
-// * log(x) and log(x, y)
-// *
-// * In SBML L1 log(x) (with exactly one argument) canonicalizes to a node
-// * of type AST_FUNCTION_LN (see L1 Specification, Appendix C), whereas
-// * log(x, y) canonicalizes to a node of type AST_FUNCTION_LOG.
-// */
-// n = NewASTNode_createWithType(AST_FUNCTION);
-// NewASTNode_setName(n, "log");
-//
-// c = NewASTNode_create();
-// NewASTNode_setName (c, "x");
-// NewASTNode_addChild(n, c);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-// fail_unless( NewASTNode_getNumChildren(n) == 1 );
-//
-// NewASTNode_canonicalize(n);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_LN );
-// fail_unless( NewASTNode_getNumChildren(n) == 1 );
-//
-// /** log(x, y) (continued) **/
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-// c = NewASTNode_create();
-// NewASTNode_setName (c, "y");
-// NewASTNode_addChild(n, c);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-// fail_unless( NewASTNode_getNumChildren(n) == 2 );
-//
-// NewASTNode_canonicalize(n);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_LOG );
-//
-// delete n;
-//
-//
-// /** log10(x) -> log(10, x) **/
-// n = NewASTNode_createWithType(AST_FUNCTION);
-// NewASTNode_setName(n, "log10");
-//
-// c = NewASTNode_create();
-// NewASTNode_setName (c, "x");
-// NewASTNode_addChild(n, c);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-// fail_unless( NewASTNode_getNumChildren(n) == 1 );
-//
-// NewASTNode_canonicalize(n);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_LOG );
-// fail_unless( NewASTNode_getNumChildren(n) == 2 );
-//
-// c = NewASTNode_getLeftChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_INTEGER );
-// fail_unless( NewASTNode_getInteger(c) == 10 );
-//
-// c = NewASTNode_getRightChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_NAME );
-// fail_unless( !strcmp(NewASTNode_getName(c), "x") );
-//
-// delete n;
-//
-//
-// /** sqr(x) -> power(x, 2) **/
-// n = NewASTNode_createWithType(AST_FUNCTION);
-// NewASTNode_setName(n, "sqr");
-//
-// c = NewASTNode_create();
-// NewASTNode_setName (c, "x");
-// NewASTNode_addChild(n, c);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-// fail_unless( NewASTNode_getNumChildren(n) == 1 );
-//
-// NewASTNode_canonicalize(n);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_POWER );
-// fail_unless( NewASTNode_getNumChildren(n) == 2 );
-//
-// c = NewASTNode_getLeftChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_NAME );
-// fail_unless( !strcmp(NewASTNode_getName(c), "x") );
-//
-// c = NewASTNode_getRightChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_INTEGER );
-// fail_unless( NewASTNode_getInteger(c) == 2 );
-//
-// delete n;
-//
-//
-// /** sqrt(x) -> root(2, x) **/
-// n = NewASTNode_createWithType(AST_FUNCTION);
-// NewASTNode_setName(n, "sqrt");
-//
-// c = NewASTNode_create();
-// NewASTNode_setName (c, "x");
-// NewASTNode_addChild(n, c);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-// fail_unless( NewASTNode_getNumChildren(n) == 1 );
-//
-// NewASTNode_canonicalize(n);
-//
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION_ROOT );
-// fail_unless( NewASTNode_getNumChildren(n) == 2 );
-//
-// c = NewASTNode_getLeftChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_INTEGER );
-// fail_unless( NewASTNode_getInteger(c) == 2 );
-//
-// c = NewASTNode_getRightChild(n);
-// fail_unless( NewASTNode_getType(c) == AST_NAME );
-// fail_unless( !strcmp(NewASTNode_getName(c), "x") );
-//
-// delete n;
-//}
-//END_TEST
-//
-//
-//START_TEST (test_NewASTNode_canonicalizeLogical)
-//{
-// NewASTNode_t *n = NewASTNode_createWithType(AST_FUNCTION);
-//
-//
-// /** and **/
-// NewASTNode_setName(n, "and");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_LOGICAL_AND );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** not **/
-// NewASTNode_setName(n, "not");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_LOGICAL_NOT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** or **/
-// NewASTNode_setName(n, "or");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_LOGICAL_OR );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** xor **/
-// NewASTNode_setName(n, "xor");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_LOGICAL_XOR );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// delete n;
-//}
-//END_TEST
-//
-//
-//START_TEST (test_NewASTNode_canonicalizeRelational)
-//{
-// NewASTNode_t *n = NewASTNode_createWithType(AST_FUNCTION);
-//
-//
-// /** eq **/
-// NewASTNode_setName(n, "eq");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_EQ );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** geq **/
-// NewASTNode_setName(n, "geq");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_GEQ );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** gt **/
-// NewASTNode_setName(n, "gt");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_GT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** leq **/
-// NewASTNode_setName(n, "leq");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_LEQ );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** lt **/
-// NewASTNode_setName(n, "lt");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_LT );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// /** neq **/
-// NewASTNode_setName(n, "neq");
-// fail_unless( NewASTNode_getType(n) == AST_FUNCTION );
-//
-// NewASTNode_canonicalize(n);
-// fail_unless( NewASTNode_getType(n) == AST_RELATIONAL_NEQ );
-//
-// NewASTNode_setType(n, AST_FUNCTION);
-//
-//
-// delete n;
-//}
-//END_TEST
-//
-//
+START_TEST (test_NewASTNode_canonicalizeConstants)
+{
+ NewASTNode *n = new NewASTNode();
+
+
+ /** ExponentialE **/
+ n->setName("ExponentialE");
+ fail_unless( n->isName());
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_CONSTANT_E );
+
+ n->setType(AST_NAME);
+
+
+ /** False **/
+ n->setName("False");
+ fail_unless( n->isName());
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_CONSTANT_FALSE );
+
+ n->setType(AST_NAME);
+
+
+ /** Pi **/
+ n->setName("Pi");
+ fail_unless( n->isName());
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_CONSTANT_PI );
+
+ n->setType(AST_NAME);
+
+
+ /** True **/
+ n->setName("True");
+ fail_unless( n->isName());
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_CONSTANT_TRUE );
+
+ n->setType(AST_NAME);
+
+
+ /** Foo **/
+ n->setName("Foo");
+ fail_unless( n->isName());
+
+ n->canonicalize();
+ fail_unless( n->isName());
+
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_canonicalizeFunctions)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION);
+
+
+ /** abs **/
+ n->setName("abs");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ABS );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccos **/
+ n->setName("arccos");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCOS );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccosh **/
+ n->setName("arccosh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCOSH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccot **/
+ n->setName("arccot");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCOT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccoth **/
+ n->setName("arccoth");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCOTH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccsc **/
+ n->setName("arccsc");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCSC );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arccsch **/
+ n->setName("arccsch");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCSCH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arcsec **/
+ n->setName("arcsec");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCSEC );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arcsech **/
+ n->setName("arcsech");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCSECH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arcsin **/
+ n->setName("arcsin");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCSIN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arcsinh **/
+ n->setName("arcsinh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCSINH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arctan **/
+ n->setName("arctan");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCTAN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** arctanh **/
+ n->setName("arctanh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCTANH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** ceiling **/
+ n->setName("ceiling");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_CEILING );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** cos **/
+ n->setName("cos");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_COS );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** cosh **/
+ n->setName("cosh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_COSH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** cot **/
+ n->setName("cot");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_COT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** coth **/
+ n->setName("coth");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_COTH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** csc **/
+ n->setName("csc");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_CSC );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** csch **/
+ n->setName("csch");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_CSCH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** exp **/
+ n->setName("exp");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_EXP );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** factorial **/
+ n->setName("factorial");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_FACTORIAL );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** floor **/
+ n->setName("floor");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_FLOOR );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** lambda **/
+ n->setName("lambda");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_LAMBDA );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** ln **/
+ n->setName("ln");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_LN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** log **/
+ n->setName("log");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_LOG );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** piecewise **/
+ n->setName("piecewise");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_PIECEWISE );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** power **/
+ n->setName("power");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_POWER );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** root **/
+ n->setName("root");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ROOT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** sec **/
+ n->setName("sec");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_SEC );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** sech **/
+ n->setName("sech");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_SECH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** sin **/
+ n->setName("sin");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_SIN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** sinh **/
+ n->setName("sinh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_SINH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** tan **/
+ n->setName("tan");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_TAN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** tanh **/
+ n->setName("tanh");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_TANH );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** Foo **/
+ n->setName("Foo");
+ fail_unless( n->getType() == AST_FUNCTION);
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION );
+
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_canonicalizeFunctionsL1)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION);
+ NewASTNode *c;
+
+
+ /** acos **/
+ n->setName("acos");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCCOS );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** asin **/
+ n->setName("asin");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCSIN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** atan **/
+ n->setName("atan");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_ARCTAN );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** ceil **/
+ n->setName("ceil");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_CEILING );
+
+ n->setType(AST_FUNCTION);
+
+ /** pow **/
+ n->setName("pow");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_FUNCTION_POWER );
+
+ delete n;
+
+ /**
+ * log(x) and log(x, y)
+ *
+ * In SBML L1 log(x) (with exactly one argument) canonicalizes to a node
+ * of type AST_FUNCTION_LN (see L1 Specification, Appendix C), whereas
+ * log(x, y) canonicalizes to a node of type AST_FUNCTION_LOG.
+ */
+ n = new NewASTNode(AST_FUNCTION);
+ n->setName("log");
+
+ c = new NewASTNode();
+ c->setName ("x");
+ n->addChild(c);
+
+ fail_unless( n->getType() == AST_FUNCTION );
+ fail_unless( n->getNumChildren() == 1 );
+
+ n->canonicalize();
+
+ fail_unless( n->getType() == AST_FUNCTION_LN );
+ fail_unless( n->getNumChildren() == 1 );
+
+ /** log(x, y) (continued) **/
+ n->setType(AST_FUNCTION);
+ n->setName("log");
+
+ c = new NewASTNode();
+ c->setName ("y");
+ n->addChild(c);
+
+ fail_unless( n->getType() == AST_FUNCTION );
+ fail_unless( n->getNumChildren() == 2 );
+
+ n->canonicalize();
+
+ fail_unless( n->getType() == AST_FUNCTION_LOG );
+
+ delete n;
+
+
+ /** log10(x) -> log(10, x) **/
+ n = new NewASTNode(AST_FUNCTION);
+ n->setName("log10");
+
+ c = new NewASTNode();
+ c->setName ("x");
+ n->addChild(c);
+
+ fail_unless( n->getType() == AST_FUNCTION );
+ fail_unless( n->getNumChildren() == 1 );
+
+ n->canonicalize();
+
+ fail_unless( n->getType() == AST_FUNCTION_LOG );
+ fail_unless( n->getNumChildren() == 2 );
+
+ c = n->getLeftChild();
+ fail_unless( c->getType() == AST_INTEGER );
+ fail_unless( c->getInteger() == 10 );
+
+ c = n->getRightChild();
+ fail_unless( c->getType() == AST_NAME );
+ fail_unless( !strcmp(c->getName(), "x") );
+
+ delete n;
+
+
+ /** sqr(x) -> power(x, 2) **/
+ n = new NewASTNode(AST_FUNCTION);
+ n->setName("sqr");
+
+ c = new NewASTNode();
+ c->setName ("x");
+ n->addChild(c);
+
+ fail_unless( n->getType() == AST_FUNCTION );
+ fail_unless( n->getNumChildren() == 1 );
+
+ n->canonicalize();
+
+ fail_unless( n->getType() == AST_FUNCTION_POWER );
+ fail_unless( n->getNumChildren() == 2 );
+
+ c = n->getLeftChild();
+ fail_unless( c->getType() == AST_NAME );
+ fail_unless( !strcmp(c->getName(), "x") );
+
+ c = n->getRightChild();
+ fail_unless( c->getType() == AST_INTEGER );
+ fail_unless( c->getInteger() == 2 );
+
+ delete n;
+
+
+ /** sqrt(x) -> root(2, x) **/
+ n = new NewASTNode(AST_FUNCTION);
+ n->setName("sqrt");
+
+ c = new NewASTNode();
+ c->setName ("x");
+ n->addChild(c);
+
+ fail_unless( n->getType() == AST_FUNCTION );
+ fail_unless( n->getNumChildren() == 1 );
+
+ n->canonicalize();
+
+ fail_unless( n->getType() == AST_FUNCTION_ROOT );
+ fail_unless( n->getNumChildren() == 2 );
+
+ c = n->getLeftChild();
+ fail_unless( c->getType() == AST_INTEGER );
+ fail_unless( c->getInteger() == 2 );
+
+ c = n->getRightChild();
+ fail_unless( c->getType() == AST_NAME );
+ fail_unless( !strcmp(c->getName(), "x") );
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_canonicalizeLogical)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION);
+
+
+ /** and **/
+ n->setName("and");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_LOGICAL_AND );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** not **/
+ n->setName("not");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_LOGICAL_NOT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** or **/
+ n->setName("or");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_LOGICAL_OR );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** xor **/
+ n->setName("xor");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_LOGICAL_XOR );
+
+ n->setType(AST_FUNCTION);
+
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_canonicalizeRelational)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION);
+
+
+ /** eq **/
+ n->setName("eq");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_EQ );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** geq **/
+ n->setName("geq");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_GEQ );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** gt **/
+ n->setName("gt");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_GT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** leq **/
+ n->setName("leq");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_LEQ );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** lt **/
+ n->setName("lt");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_LT );
+
+ n->setType(AST_FUNCTION);
+
+
+ /** neq **/
+ n->setName("neq");
+ fail_unless( n->getType() == AST_FUNCTION );
+
+ n->canonicalize();
+ fail_unless( n->getType() == AST_RELATIONAL_NEQ );
+
+ n->setType(AST_FUNCTION);
+
+
+ delete n;
+}
+END_TEST
+
+
START_TEST (test_NewASTNode_deepCopy_1)
{
NewASTNode *node = new NewASTNode();
@@ -4400,11 +4401,11 @@
// do we need these for the new stuff
//tcase_add_test( tcase, test_NewASTNode_createFromToken );
- //tcase_add_test( tcase, test_NewASTNode_canonicalizeConstants );
- //tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctions );
- //tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctionsL1 );
- //tcase_add_test( tcase, test_NewASTNode_canonicalizeLogical );
- //tcase_add_test( tcase, test_NewASTNode_canonicalizeRelational );
+ tcase_add_test( tcase, test_NewASTNode_canonicalizeConstants );
+ tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctions );
+ tcase_add_test( tcase, test_NewASTNode_canonicalizeFunctionsL1 );
+ tcase_add_test( tcase, test_NewASTNode_canonicalizeLogical );
+ tcase_add_test( tcase, test_NewASTNode_canonicalizeRelational );
tcase_add_test( tcase, test_NewASTNode_deepCopy_1 );
tcase_add_test( tcase, test_NewASTNode_deepCopy_2 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-27 14:07:05
|
Revision: 19289
http://sourceforge.net/p/sbml/code/19289
Author: sarahkeating
Date: 2013-11-27 14:07:03 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
tidying up commented out stuff
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.h
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.h 2013-11-27 12:12:17 UTC (rev 19288)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.h 2013-11-27 14:07:03 UTC (rev 19289)
@@ -113,60 +113,6 @@
virtual int swapChildren(ASTFunctionBase* that);
- // /** @cond doxygen-libsbml-internal */
-
- // /**
- // * Sets the parent SBML object.
- // *
- // * @param sb the parent SBML object of this ASTNode.
- // */
- // void setParentSBMLObject(SBase * sb);
-
- // /** @endcond */
-
-
- // /**
- // * Returns the parent SBML object.
- // *
- // * @return the parent SBML object of this ASTNode.
- // */
- // SBase * getParentSBMLObject() const;
-
-
- ///**
- // * Sets the user data of this node. This can be used by the application
- // * developer to attach custom information to the node. In case of a deep
- // * copy this attribute will passed as it is. The attribute will be never
- // * interpreted by this class.
- // *
- // * @param userData specifies the new user data.
- // *
- // * @return integer value indicating success/failure of the
- // * function. The possible values returned by this function are:
- // * @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
- // * @li @link OperationReturnValues_t#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink
- // */
- // int setUserData(void *userData);
-
-
- ///**
- // * Returns the user data that has been previously set via setUserData().
- // *
- // * @return the user data of this node, or @c NULL if no user data has been set.
- // *
- // * @if clike
- // * @see ASTNode::setUserData
- // * @endif@~
- // */
- // void *getUserData() const;
-
- //virtual double getValue() const;
-
- //virtual bool isSetValue() const ;
-
- //virtual int setValue(long integer);
-
- //virtual int unsetValue();
virtual void write(XMLOutputStream& stream) const;
virtual bool read(XMLInputStream& stream);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-27 12:12:20
|
Revision: 19288
http://sourceforge.net/p/sbml/code/19288
Author: sarahkeating
Date: 2013-11-27 12:12:17 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
continuing to add functions that are on the original astnodes
generally this provide helper functions to facilitate other things so are not directly part of the ASTNode API
might want to move some of them down into my hierarchicy of classes at some point
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewWriteMathMLFromAST.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.cpp 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/ASTFunctionBase.cpp 2013-11-27 12:12:17 UTC (rev 19288)
@@ -186,6 +186,7 @@
if (child == NULL) return LIBSBML_INVALID_OBJECT;
unsigned int numBefore = getNumChildren();
+ child->setIsChildFlag(true);
mChildren->prepend(child);
if (getNumChildren() == numBefore + 1)
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.cpp 2013-11-27 12:12:17 UTC (rev 19288)
@@ -2140,7 +2140,191 @@
}
+void
+NewASTNode::renameSIdRefs(const std::string& oldid, const std::string& newid)
+{
+ if (getType() == AST_NAME ||
+ getType() == AST_FUNCTION ||
+ getType() == AST_UNKNOWN)
+ {
+ if (getName() == oldid)
+ {
+ setName(newid.c_str());
+ }
+ }
+
+ for (unsigned int child=0; child<getNumChildren(); child++)
+ {
+ getChild(child)->renameSIdRefs(oldid, newid);
+ }
+}
+
+
+void
+NewASTNode::renameUnitSIdRefs(const std::string& oldid, const std::string& newid)
+{
+ if (isSetUnits())
+ {
+ if (getUnits() == oldid)
+ {
+ setUnits(newid);
+ }
+ }
+
+ for (unsigned int child=0; child<getNumChildren(); child++)
+ {
+ getChild(child)->renameUnitSIdRefs(oldid, newid);
+ }
+}
+
+
+void
+NewASTNode::replaceIDWithFunction(const std::string& id, const NewASTNode* function)
+{
+ for (unsigned int i=0; i<getNumChildren(); i++)
+ {
+ NewASTNode* child = getChild(i);
+ if (child->getType() == AST_NAME &&
+ child->getName() == id)
+ {
+ replaceChild(i, function->deepCopy());
+ }
+ else
+ {
+ child->replaceIDWithFunction(id, function);
+ }
+ }
+}
+
+
void
+NewASTNode::reduceToBinary()
+{
+ unsigned int numChildren = getNumChildren();
+ /* number of children should be greater than 2 */
+ if (numChildren < 3)
+ return;
+
+ NewASTNode* op = new NewASTNode( getType() );
+ NewASTNode* op2 = new NewASTNode( getType() );
+
+ // add the first two children to the first node
+ op->addChild(getChild(0));
+ op->addChild(getChild(1));
+
+ op2->addChild(op);
+
+ for (unsigned int n = 2; n < numChildren; n++)
+ {
+ op2->addChild(getChild(n));
+ }
+
+ swapChildren(op2);
+
+ reduceToBinary();
+}
+
+
+bool
+NewASTNode::isWellFormedASTNode() const
+{
+ bool valid = hasCorrectNumberArguments();
+ unsigned int numChildren = getNumChildren();
+ unsigned int i = 0;
+
+ // check number of arguments
+ while (valid && i < numChildren)
+ {
+ valid = getChild(i)->isWellFormedASTNode();
+ i++;
+ }
+ return valid;
+}
+
+
+bool
+NewASTNode::hasCorrectNumberArguments() const
+{
+ bool correctNum = true;
+ int type = getType();
+ unsigned int numChildren = getNumChildren();
+
+ // user functions we do not know the expected number of arguments
+ // so they are always correct
+ if (isUserFunction() == true)
+ {
+ return correctNum;
+ }
+
+ // lambda and piecewise must have one
+ if (isLambda() == true || isPiecewise() == true)
+ {
+ if (numChildren < 1)
+ {
+ correctNum = false;
+ }
+ }
+ else if (isUnaryFunction() == true)
+ {
+ if (numChildren != 1)
+ {
+ correctNum = false;
+ }
+ }
+ else if (isBinaryFunction() == true)
+ {
+ if (numChildren != 2)
+ {
+ correctNum = false;
+ }
+ }
+ else if (representsNumber(type))
+ {
+ if (numChildren != 0)
+ {
+ correctNum = false;
+ }
+ }
+ else if (representsFunctionRequiringAtLeastTwoArguments(type))
+ {
+ if (numChildren < 2)
+ {
+ correctNum = false;
+ }
+ }
+ else
+ {
+ // look at anomalies
+ if (type == AST_MINUS)
+ {
+ if (numChildren < 1 || numChildren > 2)
+ {
+ correctNum = false;
+ }
+ }
+ else if (type == AST_FUNCTION_LOG || type == AST_FUNCTION_ROOT)
+ {
+ if (numChildren < 1 || numChildren > 2)
+ {
+ correctNum = false;
+ }
+ else if (numChildren == 1)
+ {
+ // we have only one child
+ // if it is a qualifier type then it is incorrect
+ if (representsQualifier(getChild(0)->getType()) == true)
+ {
+ correctNum = false;
+ }
+ }
+ }
+ }
+
+ return correctNum;
+}
+
+
+void
NewASTNode::reset()
{
if (mNumber != NULL)
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 12:12:17 UTC (rev 19288)
@@ -1266,14 +1266,14 @@
/**
* Renames all the SIdRef attributes on this node and any child node
*/
- //virtual void renameSIdRefs(const std::string& oldid, const std::string& newid);
+ virtual void renameSIdRefs(const std::string& oldid, const std::string& newid);
/**
* Renames all the UnitSIdRef attributes on this node and any child node.
* (The only place UnitSIDRefs appear in MathML <code><cn></code> elements.)
*/
-// virtual void renameUnitSIdRefs(const std::string& oldid, const std::string& newid);
+ virtual void renameUnitSIdRefs(const std::string& oldid, const std::string& newid);
/** @cond doxygenLibsbmlInternal */
@@ -1282,7 +1282,7 @@
* Replace any nodes of type AST_NAME with the name 'id' from the child 'math' object with the provided ASTNode.
*
*/
-// virtual void replaceIDWithFunction(const std::string& id, const ASTNode* function);
+ virtual void replaceIDWithFunction(const std::string& id, const NewASTNode* function);
/** @endcond */
@@ -1403,7 +1403,7 @@
* formula of the reduced node is <code>and(and(x, y), z)</code>. The
* operation replaces the formula stored in the current ASTNode object.
*/
- // void reduceToBinary();
+ void reduceToBinary();
/**
@@ -1446,7 +1446,7 @@
*
* @see hasCorrectNumberArguments()
*/
- // bool isWellFormedASTNode() const;
+ bool isWellFormedASTNode() const;
/**
@@ -1464,7 +1464,7 @@
*
* @see isWellFormedASTNode()
*/
- // bool hasCorrectNumberArguments() const;
+ bool hasCorrectNumberArguments() const;
/* additional to original AST */
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c 2013-11-27 12:12:17 UTC (rev 19288)
@@ -2831,6 +2831,41 @@
END_TEST
+START_TEST (test_ASTNode_reduceToBinary)
+{
+ ASTNode_t *n = ASTNode_create();
+ ASTNode_setType(n, AST_PLUS);
+ ASTNode_t *c = ASTNode_create();
+ ASTNode_setInteger(c, 1);
+ ASTNode_t *c1 = ASTNode_create();
+ ASTNode_setInteger(c1, 2);
+ ASTNode_t *c2 = ASTNode_create();
+ ASTNode_setInteger(c2, 2);
+
+ ASTNode_addChild(n, c1);
+ ASTNode_addChild(n, c2);
+ ASTNode_addChild(n, c2);
+
+ fail_unless( ASTNode_getNumChildren(n) == 3);
+
+ ASTNode_reduceToBinary(n);
+
+ fail_unless( ASTNode_getNumChildren(n) == 2);
+
+ ASTNode_t * child = ASTNode_getChild(n, 0);
+
+ fail_unless(ASTNode_getNumChildren(child) == 2);
+
+ child = ASTNode_getChild(n, 1);
+
+ fail_unless(ASTNode_getNumChildren(child) == 0);
+
+
+ //ASTNode_free(n);
+}
+END_TEST
+
+
Suite *
create_suite_ASTNode (void)
{
@@ -2888,6 +2923,7 @@
tcase_add_test( tcase, test_ASTNode_isAvogadro );
tcase_add_test( tcase, test_ASTNode_hasTypeAndNumChildren );
tcase_add_test( tcase, test_ASTNode_hasUnits );
+ tcase_add_test( tcase, test_ASTNode_reduceToBinary );
suite_add_tcase(suite, tcase);
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 12:12:17 UTC (rev 19288)
@@ -45,6 +45,7 @@
extern int finite(double x);
#endif
+
#if defined(__cplusplus)
LIBSBML_CPP_NAMESPACE_USE
CK_CPPSTART
@@ -985,6 +986,8 @@
fail_unless( child->getInteger () == 2 );
fail_unless( child->getNumChildren() == 0 );
+ fail_unless(node->isWellFormedASTNode() == true);
+
delete node;
delete copy;
}
@@ -1013,6 +1016,8 @@
fail_unless( node->getName() != copy->getName() );
+ fail_unless(node->isWellFormedASTNode() == true);
+
delete node;
delete copy;
}
@@ -1040,6 +1045,8 @@
fail_unless( copy->getName() != node->getName() );
+ fail_unless(node->isWellFormedASTNode() == true);
+
delete node;
delete copy;
}
@@ -1067,6 +1074,8 @@
fail_unless( copy->getName() != node->getName() );
+ fail_unless(node->isWellFormedASTNode() == false);
+
delete node;
delete copy;
}
@@ -1092,6 +1101,8 @@
fail_unless( copy->getInteger() == 2 );
fail_unless( copy->getNumChildren() == 0 );
+ fail_unless(node->isWellFormedASTNode() == true);
+
delete node;
delete copy;
}
@@ -1106,88 +1117,111 @@
/** AST_NAMEs **/
n->setName("foo");
fail_unless( !strcmp(n->getName(), "foo") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_NAME_TIME);
fail_unless( !strcmp(n->getName(), "foo") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setName(NULL);
fail_unless( n->getName() == NULL );
+ fail_unless(n->isWellFormedASTNode() == true);
/** AST_CONSTANTs **/
n->setType(AST_CONSTANT_E);
fail_unless( !strcmp(n->getName(), "exponentiale") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_CONSTANT_FALSE);
fail_unless( !strcmp(n->getName(), "false") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_CONSTANT_PI);
fail_unless( !strcmp(n->getName(), "pi") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_CONSTANT_TRUE);
fail_unless( !strcmp(n->getName(), "true") );
+ fail_unless(n->isWellFormedASTNode() == true);
///** AST_LAMBDA **/
n->setType(AST_LAMBDA);
fail_unless( !strcmp(n->getName(), "lambda") );
+ fail_unless(n->isWellFormedASTNode() == false);
///** AST_FUNCTION (user-defined) **/
n->setType(AST_FUNCTION);
n->setName("f");
fail_unless( !strcmp(n->getName(), "f") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_FUNCTION_DELAY);
fail_unless( !strcmp(n->getName(), "f") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setName(NULL);
fail_unless( !strcmp(n->getName(), "delay") );
n->setType(AST_FUNCTION);
fail_unless( n->getName() == NULL );
+ fail_unless(n->isWellFormedASTNode() == true);
///** AST_FUNCTIONs (builtin) **/
n->setType(AST_FUNCTION_ABS);
fail_unless( !strcmp(n->getName(), "abs") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_FUNCTION_ARCCOS);
fail_unless( !strcmp(n->getName(), "arccos") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_FUNCTION_TAN);
fail_unless( !strcmp(n->getName(), "tan") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_FUNCTION_TANH);
fail_unless( !strcmp(n->getName(), "tanh") );
+ fail_unless(n->isWellFormedASTNode() == false);
///** AST_LOGICALs **/
n->setType(AST_LOGICAL_AND);
fail_unless( !strcmp(n->getName(), "and") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_LOGICAL_NOT);
fail_unless( !strcmp(n->getName(), "not") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_LOGICAL_OR);
fail_unless( !strcmp(n->getName(), "or") );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_LOGICAL_XOR);
fail_unless( !strcmp(n->getName(), "xor") );
+ fail_unless(n->isWellFormedASTNode() == true);
///** AST_RELATIONALs **/
n->setType(AST_RELATIONAL_EQ);
fail_unless( !strcmp(n->getName(), "eq") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_RELATIONAL_GEQ);
fail_unless( !strcmp(n->getName(), "geq") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_RELATIONAL_LT);
fail_unless( !strcmp(n->getName(), "lt") );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_RELATIONAL_NEQ);
fail_unless( !strcmp(n->getName(), "neq") );
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
}
@@ -1215,6 +1249,8 @@
n->setValue(long(1), 2);
fail_unless(n->getReal() == 0.5);
+
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1229,6 +1265,8 @@
fail_unless(n->getType() == AST_INTEGER);
fail_unless(n->getInteger() == 4);
+ fail_unless(n->isWellFormedASTNode() == true);
+
delete n;
}
END_TEST
@@ -1243,6 +1281,8 @@
fail_unless(n->getDenominator() == 2);
fail_unless(n->getReal() == 2);
+ fail_unless(n->isWellFormedASTNode() == true);
+
delete n;
}
END_TEST
@@ -1257,6 +1297,8 @@
fail_unless(n->getExponent() == 2);
fail_unless(n->getReal() == 4.2e2);
+ fail_unless(n->isWellFormedASTNode() == true);
+
delete n;
}
END_TEST
@@ -1269,29 +1311,37 @@
n->setType(AST_PLUS);
fail_unless( n->getPrecedence() == 2 );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_MINUS);
fail_unless( n->getPrecedence() == 2 );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_TIMES);
fail_unless( n->getPrecedence() == 3 );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_DIVIDE);
fail_unless( n->getPrecedence() == 3 );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_POWER);
fail_unless( n->getPrecedence() == 4 );
+ fail_unless(n->isWellFormedASTNode() == false);
n->setType(AST_MINUS);
n->addChild(new NewASTNode(AST_NAME));
fail_unless( n->isUMinus() == true );
fail_unless( n->getPrecedence() == 5 );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_NAME);
fail_unless( n->getPrecedence() == 6 );
+ fail_unless(n->isWellFormedASTNode() == true);
n->setType(AST_FUNCTION);
fail_unless( n->getPrecedence() == 6 );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1310,6 +1360,7 @@
/** log() **/
n->setType(AST_FUNCTION_LOG);
fail_unless( n->isLog10() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
/** log(10) **/
c1 = new NewASTNode(AST_INTEGER);
@@ -1318,11 +1369,13 @@
n->addChild(c1);
fail_unless( n->isLog10() == true );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
/* log (base=10, ?) */
n = new NewASTNode(AST_FUNCTION_LOG);
+ fail_unless(n->isWellFormedASTNode() == false);
c1 = new NewASTNode(AST_QUALIFIER_LOGBASE);
@@ -1338,11 +1391,13 @@
fail_unless (n->addChild(c1) == LIBSBML_OPERATION_SUCCESS);
fail_unless( n->isLog10() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
/** log(10, x) -> n->isLog10() == 1 **/
fail_unless (n->addChild(c2) == LIBSBML_OPERATION_SUCCESS);
fail_unless( n->isLog10() == true );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1365,6 +1420,7 @@
/* log(2, ) */
fail_unless( n->isLog10() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
c2 = new NewASTNode(AST_INTEGER);
c2->setValue(3);
@@ -1373,6 +1429,7 @@
/* log(2, 3) */
fail_unless( n->isLog10() == false );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -1394,6 +1451,7 @@
/** root() **/
n->setType(AST_FUNCTION_ROOT);
fail_unless( n->isSqrt() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
/** root(2, ?) **/
c1_1->setValue((long)(2));
@@ -1401,14 +1459,17 @@
n->addChild(c1);
fail_unless( n->isSqrt() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
/** root(2, x) -> NewASTNode_isSqrt() == 1 **/
n->addChild(c2);
fail_unless( n->isSqrt() == true );
+ fail_unless(n->isWellFormedASTNode() == true);
/** root(3, x) **/
c1_1->setValue((long)(3));
fail_unless( n->isSqrt() == false );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1427,10 +1488,12 @@
/** root() **/
n->setType(AST_FUNCTION_ROOT);
fail_unless( n->isSqrt() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
/** root(x) -> NewASTNode_isSqrt() == 1 **/
n->addChild(c2);
fail_unless( n->isSqrt() == true );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1442,10 +1505,12 @@
NewASTNode *n = new NewASTNode(AST_MINUS);
fail_unless( n->isUMinus() == false );
+ fail_unless(n->isWellFormedASTNode() == false);
n->addChild(new NewASTNode(AST_NAME));
fail_unless( n->isUMinus() == 1 );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1457,10 +1522,12 @@
NewASTNode *n = new NewASTNode(AST_PLUS);
fail_unless( n->isUPlus() == false );
+ fail_unless(n->isWellFormedASTNode() == true);
n->addChild(new NewASTNode(AST_NAME));
fail_unless( n->isUPlus() == 1 );
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -1820,12 +1887,14 @@
right->setValue((long)(2));
right2->setValue((long)(3));
+ fail_unless(parent->isWellFormedASTNode() == true);
/**
* Two Children
*/
parent->addChild( left );
parent->addChild( right );
+ fail_unless(parent->isWellFormedASTNode() == true);
fail_unless( parent->getNumChildren() == 2 );
fail_unless( left->getNumChildren() == 0 );
fail_unless( right->getNumChildren() == 0 );
@@ -1842,6 +1911,7 @@
*/
parent->addChild(right2);
+ fail_unless(parent->isWellFormedASTNode() == true);
fail_unless( parent->getNumChildren() == 3 );
fail_unless( left->getNumChildren() == 0 );
fail_unless( right->getNumChildren() == 0 );
@@ -1873,12 +1943,15 @@
right->setValue((long)(2));
right2->setValue((long)(3));
+ fail_unless(parent->isWellFormedASTNode() == true);
+
/**
* Two Children
*/
parent->addChild( left );
parent->addChild( right );
+ fail_unless(parent->isWellFormedASTNode() == true);
fail_unless( parent->getNumChildren() == 2 );
fail_unless( left->getNumChildren() == 0 );
fail_unless( right->getNumChildren() == 0 );
@@ -1895,6 +1968,7 @@
*/
parent->addChild(right2);
+ fail_unless(parent->isWellFormedASTNode() == true);
fail_unless( parent->getNumChildren() == 3 );
fail_unless( left->getNumChildren() == 0 );
fail_unless( right->getNumChildren() == 0 );
@@ -2619,15 +2693,19 @@
NewASTNode *node = new NewASTNode(AST_SEMANTICS);
int i = 0;
+ fail_unless(node->isWellFormedASTNode() == true);
+
i = node->addSemanticsAnnotation(ann);
fail_unless(i == LIBSBML_OPERATION_SUCCESS);
fail_unless( node->getNumSemanticsAnnotations() == 1);
+ fail_unless(node->isWellFormedASTNode() == true);
i = node->addSemanticsAnnotation(NULL);
fail_unless(i == LIBSBML_OPERATION_FAILED);
fail_unless( node->getNumSemanticsAnnotations() == 1);
+ fail_unless(node->isWellFormedASTNode() == true);
delete node;
}
@@ -2640,12 +2718,15 @@
NewASTNode *node = new NewASTNode();
int i = 0;
+ fail_unless(node->isWellFormedASTNode() == true);
+
i = node->addSemanticsAnnotation(ann);
fail_unless(i == LIBSBML_OPERATION_SUCCESS);
fail_unless(node->getType() == AST_SEMANTICS);
fail_unless( node->getNumSemanticsAnnotations() == 1);
fail_unless(node->getNumChildren() == 1);
+ fail_unless(node->isWellFormedASTNode() == true);
i = node->addSemanticsAnnotation(NULL);
@@ -2663,12 +2744,15 @@
NewASTNode *node = new NewASTNode(AST_INTEGER);
int i = 0;
+ fail_unless(node->isWellFormedASTNode() == true);
+
i = node->addSemanticsAnnotation(ann);
fail_unless(i == LIBSBML_OPERATION_SUCCESS);
fail_unless(node->getType() == AST_SEMANTICS);
fail_unless( node->getNumSemanticsAnnotations() == 1);
fail_unless(node->getNumChildren() == 1);
+ fail_unless(node->isWellFormedASTNode() == true);
i = node->addSemanticsAnnotation(NULL);
@@ -2791,6 +2875,7 @@
double val = n->getReal();
fail_unless(val == 6.02214179e23);
fail_unless(n->isConstant() == true);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -2806,6 +2891,7 @@
double val = n->getReal();
fail_unless(val == 6.02214179e23);
fail_unless(n->isConstant() == true);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -2821,6 +2907,7 @@
double val = n->getReal();
fail_unless(val == 6.02214179e23);
fail_unless(n->isConstant() == true);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3371,6 +3458,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == true);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3398,6 +3486,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3425,6 +3514,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3452,6 +3542,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3479,6 +3570,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3506,6 +3598,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3534,6 +3627,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3561,6 +3655,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3588,6 +3683,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3615,6 +3711,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3642,6 +3739,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3669,6 +3767,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3696,6 +3795,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3724,6 +3824,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3752,6 +3853,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3779,6 +3881,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3806,6 +3909,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3833,6 +3937,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3860,6 +3965,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3887,6 +3993,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3914,6 +4021,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3942,6 +4050,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == false);
delete n;
@@ -3971,6 +4080,7 @@
fail_unless(n->isUMinus() == true);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -3998,6 +4108,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == true);
fail_unless(n->isUPlus() == false);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
@@ -4027,6 +4138,7 @@
fail_unless(n->isUMinus() == false);
fail_unless(n->isUnknown() == false);
fail_unless(n->isUPlus() == true);
+ fail_unless(n->isWellFormedASTNode() == true);
delete n;
}
@@ -4120,8 +4232,157 @@
END_TEST
+START_TEST (test_NewASTNode_renameSIdRefs)
+{
+ NewASTNode *n = new NewASTNode(AST_FUNCTION);
+ n->setName("x");
+ fail_unless(strcmp(n->getName(), "x") == 0);
+ n->renameSIdRefs("x", "y");
+ fail_unless(strcmp(n->getName(), "x") != 0);
+ fail_unless(strcmp(n->getName(), "y") == 0);
+
+
+ NewASTNode *c = new NewASTNode(AST_NAME);
+ c->setName("t");
+ n->addChild(c);
+
+ fail_unless(strcmp(n->getChild(0)->getName(), "t") == 0);
+
+ n->renameSIdRefs("t", "t1");
+
+ fail_unless(strcmp(n->getChild(0)->getName(), "t1") == 0);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_renameUnitSIdRefs)
+{
+ NewASTNode *n = new NewASTNode();
+ NewASTNode *c = new NewASTNode();
+
+ n->setValue(1.0);
+ n->setUnits("litre");
+ fail_unless (n->getUnits() == "litre");
+
+ n->renameUnitSIdRefs("litre", "me");
+
+ fail_unless (n->getUnits() == "me");
+
+ n = new NewASTNode(AST_PLUS);
+ c->setValue(2.0);
+ c->setUnits("a");
+ n->addChild(c);
+
+ fail_unless( n->hasUnits() == true);
+ fail_unless (n->getChild(0)->getUnits() == "a");
+
+ n->renameUnitSIdRefs("a", "me");
+
+ fail_unless (n->getChild(0)->getUnits() == "me");
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_replaceIDWithFunction_1)
+{
+ NewASTNode *n = new NewASTNode(AST_NAME);
+ n->setName("x");
+
+ NewASTNode *replaced = new NewASTNode(AST_PLUS);
+ NewASTNode *c = new NewASTNode();
+ c->setValue(1.0);
+ replaced->addChild(c);
+
+ fail_unless(strcmp(n->getName(), "x") == 0);
+ fail_unless(n->getType() == AST_NAME);
+ fail_unless(n->getNumChildren() == 0);
+
+ n->replaceIDWithFunction("x", replaced);
+
+ fail_unless(strcmp(n->getName(), "x") == 1);
+ fail_unless(n->getType() == AST_PLUS);
+ fail_unless(n->getNumChildren() == 1);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_replaceIDWithFunction_2)
+{
+ NewASTNode *n = new NewASTNode(AST_POWER);
+ NewASTNode *n1 = new NewASTNode(AST_NAME);
+ n1->setName("x");
+ NewASTNode *n2 = new NewASTNode();
+ n2->setValue(2.0);
+ n->addChild(n1);
+ n->addChild(n2);
+
+ NewASTNode *replaced = new NewASTNode(AST_PLUS);
+ NewASTNode *c = new NewASTNode();
+ c->setValue(1.0);
+ replaced->addChild(c);
+
+ NewASTNode *child = n->getChild(0);
+
+ fail_unless(strcmp(child->getName(), "x") == 0);
+ fail_unless(child->getType() == AST_NAME);
+ fail_unless(child->getNumChildren() == 0);
+
+ n->replaceIDWithFunction("x", replaced);
+
+ child = n->getChild(0);
+ fail_unless(child->getName()== NULL);
+ fail_unless(child->getType() == AST_PLUS);
+ fail_unless(child->getNumChildren() == 1);
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_reduceToBinary)
+{
+ NewASTNode *n = new NewASTNode(AST_PLUS);
+ NewASTNode *n1 = new NewASTNode();
+ n1->setValue(1.0);
+ NewASTNode *n2 = new NewASTNode();
+ n2->setValue(2.0);
+ NewASTNode *n3 = new NewASTNode();
+ n3->setValue(3.0);
+
+ n->addChild(n1);
+ n->addChild(n2);
+ n->addChild(n3);
+
+ fail_unless( n->getNumChildren() == 3);
+ fail_unless(n->isWellFormedASTNode() == true);
+
+ n->reduceToBinary();
+
+ fail_unless( n->getNumChildren() == 2);
+ fail_unless(n->isWellFormedASTNode() == true);
+
+ NewASTNode * child = n->getChild(0);
+
+ fail_unless(child->getNumChildren() == 2);
+
+ child = n->getChild(1);
+
+ fail_unless(child->getNumChildren() == 0);
+
+
+ delete n;
+}
+END_TEST
+
+
Suite *
create_suite_NewASTNode (void)
{
@@ -4212,6 +4473,11 @@
tcase_add_test( tcase, test_NewASTNode_hasTypeAndNumChildren );
tcase_add_test( tcase, test_NewASTNode_hasUnits );
+ tcase_add_test( tcase, test_NewASTNode_renameSIdRefs );
+ tcase_add_test( tcase, test_NewASTNode_renameUnitSIdRefs );
+ //tcase_add_test( tcase, test_NewASTNode_replaceIDWithFunction_1 );
+ tcase_add_test( tcase, test_NewASTNode_replaceIDWithFunction_2 );
+ tcase_add_test( tcase, test_NewASTNode_reduceToBinary );
suite_add_tcase(suite, tcase);
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewWriteMathMLFromAST.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewWriteMathMLFromAST.cpp 2013-11-27 08:08:27 UTC (rev 19287)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewWriteMathMLFromAST.cpp 2013-11-27 12:12:17 UTC (rev 19288)
@@ -1991,8 +1991,93 @@
END_TEST
+START_TEST (test_MathMLFromAST_replaceIDWithFunction_1)
+{
+ const char* expected = wrapMathML
+ (
+ " <apply>\n"
+ " <plus/>\n"
+ " <cn> 1 </cn>\n"
+ " </apply>\n"
+ );
+ const char* original = wrapMathML
+ (
+ " <ci> x </ci>\n"
+ );
+ N = new NewASTNode(AST_NAME);
+ N->setName("x");
+
+ NewASTNode *replaced = new NewASTNode(AST_PLUS);
+ NewASTNode *c = new NewASTNode();
+ c->setValue(1.0);
+ replaced->addChild(c);
+
+ S = writeNewMathMLToString(N);
+
+ fail_unless( equals(original, S) );
+
+ N->replaceIDWithFunction("x", replaced);
+
+ S = writeNewMathMLToString(N);
+
+ fail_unless( equals(expected, S) );
+
+}
+END_TEST
+
+
+START_TEST (test_MathMLFromAST_replaceIDWithFunction_2)
+{
+ const char* expected = wrapMathML
+ (
+ " <apply>\n"
+ " <power/>\n"
+ " <apply>\n"
+ " <plus/>\n"
+ " <cn> 1 </cn>\n"
+ " </apply>\n"
+ " <cn> 2 </cn>\n"
+ " </apply>\n"
+ );
+
+ const char* original = wrapMathML
+ (
+ " <apply>\n"
+ " <power/>\n"
+ " <ci> x </ci>\n"
+ " <cn> 2 </cn>\n"
+ " </apply>\n"
+ );
+
+ N = new NewASTNode(AST_POWER);
+ NewASTNode *n1 = new NewASTNode(AST_NAME);
+ n1->setName("x");
+ NewASTNode *n2 = new NewASTNode();
+ n2->setValue(2.0);
+ N->addChild(n1);
+ N->addChild(n2);
+
+ NewASTNode *replaced = new NewASTNode(AST_PLUS);
+ NewASTNode *c = new NewASTNode();
+ c->setValue(1.0);
+ replaced->addChild(c);
+
+ S = writeNewMathMLToString(N);
+
+ fail_unless( equals(original, S) );
+
+ N->replaceIDWithFunction("x", replaced);
+
+ S = writeNewMathMLToString(N);
+
+ fail_unless( equals(expected, S) );
+
+}
+END_TEST
+
+
Suite *
create_suite_NewWriteMathMLFromAST ()
{
@@ -2072,7 +2157,10 @@
tcase_add_test( tcase, test_MathMLFromAST_func_style );
tcase_add_test( tcase, test_MathMLFromAST_nested_funcs );
-
+
+ //tcase_add_test( tcase, test_MathMLFromAST_replaceIDWithFunction_1 );
+ tcase_add_test( tcase, test_MathMLFromAST_replaceIDWithFunction_2 );
+
suite_add_tcase(suite, tcase);
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sar...@us...> - 2013-11-27 08:08:29
|
Revision: 19287
http://sourceforge.net/p/sbml/code/19287
Author: sarahkeating
Date: 2013-11-27 08:08:27 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
added hasUnits and hasTypeAndNumChildren functions to NewASTNode with tests
Modified Paths:
--------------
branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c
branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
Modified: branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 08:04:53 UTC (rev 19286)
+++ branches/libsbml-ast-plugin/src/sbml/math/NewASTNode.h 2013-11-27 08:08:27 UTC (rev 19287)
@@ -984,7 +984,7 @@
* @return @c true if this ASTNode is has the specified type and number
* of children, @c false otherwise.
*/
- // int hasTypeAndNumChildren(int type, unsigned int numchildren) const;
+ int hasTypeAndNumChildren(int type, unsigned int numchildren) const;
/**
@@ -1058,7 +1058,7 @@
* @note The <code>sbml:units</code> attribute is only available in SBML
* Level 3. It may not be used in Levels 1–2 of SBML.
*/
- // bool hasUnits() const;
+ bool hasUnits() const;
/**
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c 2013-11-27 08:04:53 UTC (rev 19286)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestASTNode.c 2013-11-27 08:08:27 UTC (rev 19287)
@@ -2799,6 +2799,38 @@
END_TEST
+START_TEST (test_ASTNode_hasUnits)
+{
+ ASTNode_t *n = ASTNode_create();
+ ASTNode_t *c = ASTNode_create();
+
+ ASTNode_setInteger(n, 1);
+ fail_unless( ASTNode_hasUnits(n) == 0);
+
+ ASTNode_setUnits(n, "litre");
+ fail_unless( ASTNode_hasUnits(n) == 1);
+
+ ASTNode_free(n);
+
+ n = ASTNode_create();
+ ASTNode_setType(n, AST_PLUS);
+ ASTNode_setInteger(c, 2);
+ ASTNode_addChild(n, c);
+
+ fail_unless( ASTNode_hasUnits(n) == 0);
+
+ c = ASTNode_create();
+ ASTNode_setInteger(c, 3);
+ ASTNode_setUnits(c, "mole");
+ ASTNode_addChild(n, c);
+
+ fail_unless( ASTNode_hasUnits(n) == 1);
+
+ ASTNode_free(n);
+}
+END_TEST
+
+
Suite *
create_suite_ASTNode (void)
{
@@ -2855,6 +2887,7 @@
tcase_add_test( tcase, test_ASTNode_returnsBoolean );
tcase_add_test( tcase, test_ASTNode_isAvogadro );
tcase_add_test( tcase, test_ASTNode_hasTypeAndNumChildren );
+ tcase_add_test( tcase, test_ASTNode_hasUnits );
suite_add_tcase(suite, tcase);
Modified: branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp
===================================================================
--- branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 08:04:53 UTC (rev 19286)
+++ branches/libsbml-ast-plugin/src/sbml/math/test/TestNewASTNode.cpp 2013-11-27 08:08:27 UTC (rev 19287)
@@ -4055,6 +4055,73 @@
END_TEST
+START_TEST (test_NewASTNode_hasTypeAndNumChildren)
+{
+ NewASTNode *n = new NewASTNode(AST_PLUS);
+ NewASTNode *c = new NewASTNode(AST_NAME);
+
+ fail_unless( n->hasTypeAndNumChildren(AST_PLUS, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 1));
+ fail_unless(!n->hasTypeAndNumChildren(AST_MINUS, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_UNKNOWN, 1));
+
+ c->setName("x");
+ n->addChild(c);
+ //n->setType(AST_FUNCTION_PIECEWISE);
+ //fail_unless( n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 1));
+ //fail_unless(!n->hasTypeAndNumChildren(AST_FUNCTION_PIECEWISE, 0));
+ fail_unless( n->hasTypeAndNumChildren(AST_PLUS, 1));
+ fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_LOGICAL_AND, 1));
+ fail_unless(!n->hasTypeAndNumChildren(AST_DIVIDE, 0));
+
+ c = new NewASTNode();
+ c->setName("y");
+ n->addChild(c);
+ //n->setType(AST_DIVIDE);
+ //fail_unless( n->hasTypeAndNumChildren(AST_DIVIDE, 2));
+ //fail_unless(!n->hasTypeAndNumChildren(AST_DIVIDE, 0));
+ fail_unless( n->hasTypeAndNumChildren(AST_PLUS, 2));
+ fail_unless(!n->hasTypeAndNumChildren(AST_PLUS, 0));
+ fail_unless(!n->hasTypeAndNumChildren(AST_CONSTANT_E, 2));
+ fail_unless(!n->hasTypeAndNumChildren(AST_RELATIONAL_EQ, 0));
+
+ delete n;
+}
+END_TEST
+
+
+START_TEST (test_NewASTNode_hasUnits)
+{
+ NewASTNode *n = new NewASTNode();
+ NewASTNode *c = new NewASTNode();
+
+ n->setValue(1.0);
+ fail_unless( n->hasUnits() == false);
+
+ n->setUnits("litre");
+ fail_unless( n->hasUnits() == true);
+
+ n = new NewASTNode(AST_PLUS);
+ c->setValue(2.0);
+ n->addChild(c);
+
+ fail_unless( n->hasUnits() == false);
+
+ c = new NewASTNode();
+ c->setValue(2.0);
+ c->setUnits("mole");
+ n->addChild(c);
+
+ fail_unless( n->hasUnits() == true);
+
+ delete n;
+}
+END_TEST
+
+
+
+
Suite *
create_suite_NewASTNode (void)
{
@@ -4143,6 +4210,9 @@
tcase_add_test( tcase, test_NewASTNode_ParentSBMLObject );
+ tcase_add_test( tcase, test_NewASTNode_hasTypeAndNumChildren );
+ tcase_add_test( tcase, test_NewASTNode_hasUnits );
+
suite_add_tcase(suite, tcase);
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|