Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .CI/Test/ModelicaStrings.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ int main(int argc, char **argv) {
assert(0 == strcmp("bc", ModelicaStrings_substring("abc",2,3)));
assert(0 == strcmp("bc", ModelicaStrings_substring("abc",2,4)));
assert(0 == strcmp("", ModelicaStrings_substring("abc",4,4)));
return 0;
}
29 changes: 29 additions & 0 deletions .CI/Test/Streams.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "../../Modelica/Resources/C-Sources/ModelicaInternal.h"
#include "Common.c"

#include <assert.h>
#include <string.h>

int main(int argc, char **argv) {
const char* fileName = "test.txt";
const char* line;
const char* lines[5];
int endOfFile;
ModelicaInternal_print("Modelica\nStandard\nLibrary\nCI\n", fileName);
assert(5 == ModelicaInternal_countLines(fileName));
line = ModelicaInternal_readLine(fileName, 3, &endOfFile);
assert(0 == strcmp("Library", line));
assert(0 == endOfFile);
line = ModelicaInternal_readLine(fileName, 6, &endOfFile);
assert(0 == strcmp("", line));
assert(1 == endOfFile);
ModelicaStreams_closeFile(fileName);
ModelicaInternal_readFile(fileName, lines, 5);
assert(0 == strcmp("Modelica", lines[0]));
assert(0 == strcmp("Standard", lines[1]));
assert(0 == strcmp("Library", lines[2]));
assert(0 == strcmp("CI", lines[3]));
assert(0 == strcmp("", lines[4]));
ModelicaInternal_removeFile(fileName);
return 0;
}
4 changes: 4 additions & 0 deletions .CI/Test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if test ! "$1" = "nostatic"; then
./a.out || exit 1
"$CC" -L $LIBRARIES ModelicaStrings.c -Wl,-Bstatic -lModelicaExternalC -Wl,-Bdynamic || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES Streams.c -Wl,-Bstatic -lModelicaExternalC -Wl,-Bdynamic || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES Tables.c -Wl,-Bstatic -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -Wl,-Bdynamic -lm || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES TablesFromTxtFile.c -Wl,-Bstatic -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -Wl,-Bdynamic -lm || exit 1
Expand All @@ -27,6 +29,8 @@ if test ! "$1" = "onlystatic"; then
./a.out || exit 1
"$CC" -L $LIBRARIES -Wl,-rpath $LIBRARIES ModelicaStrings.c -lModelicaExternalC || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES -Wl,-rpath $LIBRARIES Streams.c -lModelicaExternalC || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES -Wl,-rpath $LIBRARIES Tables.c -lModelicaStandardTables -lModelicaIO -lModelicaMatIO || exit 1
./a.out || exit 1
"$CC" -L $LIBRARIES -Wl,-rpath $LIBRARIES TablesFromMatFile.c -lModelicaStandardTables -lModelicaIO -lModelicaMatIO || exit 1
Expand Down
Loading