Download tests/src/App/License.cpp from AbdulElahGwaith/FreeCAD: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/App/License.cpp
- Command line
-
hf download hf://AbdulElahGwaith/FreeCAD/tests/src/App/License.cpp
-
curl -L -o License.cpp https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/App/License.cpp
1.21 kB
| // SPDX-License-Identifier: LGPL-2.1-or-later | |
| TEST(License, isLicenseEmpty) | |
| { | |
| EXPECT_EQ(App::findLicense(""), -1); | |
| } | |
| TEST(License, isLicenseNull) | |
| { | |
| EXPECT_EQ(App::findLicense(nullptr), -1); | |
| } | |
| TEST(License, isLicenseYesStr) | |
| { | |
| EXPECT_EQ(App::findLicense("CC_BY_40"), 1); | |
| } | |
| TEST(License, UnknownIdentifier) | |
| { | |
| int index {App::findLicense("junk")}; | |
| EXPECT_EQ(index, -1); | |
| } | |
| TEST(License, direct) | |
| { | |
| int posn {App::findLicense("CC_BY_40")}; | |
| App::TLicenseArr tt { | |
| "CC_BY_40", | |
| "Creative Commons Attribution 4.0", | |
| "https://creativecommons.org/licenses/by/4.0/" | |
| }; | |
| EXPECT_STREQ(App::licenseItems.at(posn).at(0), tt.at(0)); | |
| EXPECT_STREQ(App::licenseItems.at(posn).at(1), tt.at(1)); | |
| EXPECT_STREQ(App::licenseItems.at(posn).at(2), tt.at(2)); | |
| } | |
| TEST(License, findLicenseByIdent) | |
| { | |
| App::TLicenseArr arr {App::licenseItems.at(App::findLicense("CC_BY_40"))}; | |
| EXPECT_STREQ(arr.at(App::posnOfIdentifier), "CC_BY_40"); | |
| EXPECT_STREQ(arr.at(App::posnOfFullName), "Creative Commons Attribution 4.0"); | |
| EXPECT_STREQ(arr.at(App::posnOfUrl), "https://creativecommons.org/licenses/by/4.0/"); | |
| } | |