diff --git a/src/private/maox_caosdb.cpp b/src/private/maox_caosdb.cpp index c706ed8a23d8348bd46bdc511d67b6760a5ddfdd..53fcf743ad8fad4fea0a1a30b6f7d40c19795020 100644 --- a/src/private/maox_caosdb.cpp +++ b/src/private/maox_caosdb.cpp @@ -15,7 +15,7 @@ void print_usage() { mexPrintf("\nUsage: caosdb [OPTIONS]\n\n"); mexPrintf("Options:\n"); mexPrintf(" --help Print this help and return.\n"); - mexPrintf(" --version Print the version of OcataveCaosDB and " + mexPrintf(" --version Print the version of OctaveCaosDB and " "libcaosdb and return.\n"); mexPrintf( " --test-connection Test the default connection and return.\n"); diff --git a/test/Run_Test.m b/test/Run_Test.m index 374da3ca629b360779a0d404ddc6451ed6f5cc50..067c7d4af7beb19548ad832723d1865258e79245 100644 --- a/test/Run_Test.m +++ b/test/Run_Test.m @@ -17,4 +17,4 @@ % along with this program. If not, see <https://www.gnu.org/licenses/>. pkg load caosdb; -moxunit_runtests -verbose test_caosdb.m; +moxunit_runtests -verbose test_unittest.m; diff --git a/test/test_caosdb.m b/test/test_unittest.m similarity index 63% rename from test/test_caosdb.m rename to test/test_unittest.m index 057b5c1aaa97561efb3b832d30ab7b804cebbf1f..d8d9de1b08664d5a28ed0e8799751b8603e543d4 100644 --- a/test/test_caosdb.m +++ b/test/test_unittest.m @@ -1,7 +1,7 @@ % This file is a part of the CaosDB Project. % % Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> -% Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> +% Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com> % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU Affero General Public License as @@ -16,15 +16,24 @@ % You should have received a copy of the GNU Affero General Public License % along with this program. If not, see <https://www.gnu.org/licenses/>. -function test_suite = test_caosdb +function test_suite=test_unittest() try % assignment of 'localfunctions' is necessary in Matlab >= 2016 - test_functions = localfunctions(); + test_functions=localfunctions(); catch % no problem; early Matlab versions can use initTestSuite fine end initTestSuite; end -function test_print_version - v = caosdb_exec("--version"); - assertEqual(v, "v0.1 (libcaosdb v0.0.6)"); +% Only tests which don't need a connection to a server. +function test_local() + % default connection + c1 = Caosdb(); + assertEqual(c1.connection, "") + % class with explicit connection + c2 = Caosdb(connection = "local-caosdb-admin"); + assertEqual(c2.connection, "local-caosdb-admin"); + + % Only get the local versions. + version = caosdb_exec("--version"); + assertEqual(version, "v0.1 (libcaosdb v0.0.6)"); end