Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Susuwu::unitTestsCxx tests ~72% of executable routes (half coverage), must do >92% to have value #14

Open
SwuduSusuwu opened this issue Jul 7, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers improve New feature or request todo unimplemented (but advertised) part of the tool

Comments

@SwuduSusuwu
Copy link
Owner

SwuduSusuwu commented Jul 7, 2024

susuwuUnitTests/Susuwu::unitTestsCxx
Rationale: has use for Agile, [_test-driven development_https://wikipedia.org/wiki/Unit_testing#Test-driven_development) workflows.
Background:
https://github.com/SwuduSusuwu/SubStack/commit/91dfea6c5378224b0561024f5d2eaf5db941d97b
https://github.com/SwuduSusuwu/SubStack/commit/9c618b927336af4043a8f564b450fb8df8cd7c2b
https://github.com/SwuduSusuwu/SubStack/commit/e5a61188db8244400ec91f7c2ac774a72feda93a
https://github.com/SwuduSusuwu/SubStack/commit/9598ddecfdb56e804084326a1fd7fc0ee45d2d18
https://github.com/SwuduSusuwu/SubStack/commit/81be1510498b0e3230508ec94984253bb6f772d0

@SwuduSusuwu SwuduSusuwu added improve New feature or request good first issue Good for newcomers labels Jul 7, 2024
@SwuduSusuwu SwuduSusuwu changed the title testHarnesses() tests ~52% of executable routes (half coverage), must do >92% to have value testHarnesses() tests ~62% of executable routes (half coverage), must do >92% to have value Sep 28, 2024
@SwuduSusuwu SwuduSusuwu changed the title testHarnesses() tests ~62% of executable routes (half coverage), must do >92% to have value testHarnesses() tests ~72% of executable routes (half coverage), must do >92% to have value Oct 5, 2024
@SwuduSusuwu SwuduSusuwu added the documentation Improvements or additions to documentation label Oct 5, 2024
@SwuduSusuwu
Copy link
Owner Author

?virusAnalysisTests() False negative tests, cache@09bd2d3 improves functional tests (unit tests)

?build.sh Use linker result as return value,@e4d6a10 improves autonomous build tests (such as GitHub scripts use)

SwuduSusuwu added a commit that referenced this issue Nov 6, 2024
?`posts/VirusAnalysis.md` /* Include this */

Has to do with #14 (improve tests).

Is followup to fc66880 (?`cxx/Macros.hxx`: +`NOEXCEPT(condition)`, typo fix).
SwuduSusuwu added a commit that referenced this issue Nov 9, 2024
	tests `SUSUWU_NO_UNIQUE_ADDRESS`.
	?`SUSUWU_NO_UNIQUE_ADDRESS`: documentation has logic fixes.

Is followup to 796d4fe (?`cxx/Macros.hxx`: +`SUSUWU_NO_UNIQUE_ADDRESS`:).
Is small step to issue #14 .
SwuduSusuwu added a commit that referenced this issue Nov 10, 2024
	Refactor, cleanup, misc fixes:
	Move `#include`'s to top (thus `namespace Susuwu {}` doesn't contain `#include`):
		?`macrosNoUniqueAddressTest`: separate from `SUSUWU_CXX20`,
		?`SUSUWU_CXX*`: move to top (due to `#include`),
	terminate English sentences (but not acronyms or source code) in comments with `.`,
	move `NOLINTBEGIN` out of `#if` block (it was in the block since the first diagnostic which it silences is in the block, but `NOLINTEND` isn't in the block),
	group `#define __WIN32__` close to `#define __POSIX_SOURCE`,
	remove extra `#define __POSIX_SOURCE`,
	?`SUSUWU_PRAGMA`, ?`SUSUWU_SH_ST`: comment has English fix,
	?`SUSUWU_SH_RUNTIME_COLORS`, ?`SUSUWU_SH_RUNTIME_OSC`: upgrade `#pragma message` (for early users) from `Notice:` to `Info:`.

?`cxx/Macros.*xx`:
	?`macrosNoUniqueAddressTest`: is now `static`, move into `cxx/Macros.cxx`.
	+`macroTestsNoexcept`: has macro tests which were in `testHarnesses`, calls `macrosNoUniqueAddressTest`.

?`cxx/main.cxx`: ?`testHarnesses`:
  now calls `macroTestsNoexcept`.
  was `[[noreturn]]`, now has `return 0;`.

?`build.sh`: compile `cxx/Macros.cxx` into `Macros.o`, link `Macros.o` into `a.out`.

?`posts/VirusAnalysis.md`: include all this, except 100 lines of: unused OSC `sh` commands + disabled colors.

Is progress to issue #14 .

Is followup to bdfb817 (?`cxx/Macros`: +`macrosNoUniqueAddressTest()`:) c23165a (Prefix `SUSUWU_` to macros) 7dcf2bc (...test `NOEXCEPT(condition)`.) ce649ab
(?cxx/Macros.hxx `clang-tidy` fixes).
SwuduSusuwu added a commit that referenced this issue Nov 10, 2024
	Refactor, cleanup, misc fixes:
	Move `#include`'s to top (thus `namespace Susuwu {}` doesn't contain `#include`):
		?`macrosNoUniqueAddressTest`: separate from `SUSUWU_CXX20`,
		?`SUSUWU_CXX*`: move to top (due to `#include`),
	terminate English sentences (but not acronyms or source code) in comments with `.`,
	move `NOLINTBEGIN` out of `#if` block (it was in the block since the first diagnostic which it silences is in the block, but `NOLINTEND` isn't in the block),
	group `#define __WIN32__` close to `#define __POSIX_SOURCE`,
	remove extra `#define __POSIX_SOURCE`,
	?`SUSUWU_PRAGMA`, ?`SUSUWU_SH_ST`: comment has English fix,
	?`SUSUWU_SH_RUNTIME_COLORS`, ?`SUSUWU_SH_RUNTIME_OSC`: upgrade `#pragma message` (for early users) from `Notice:` to `Info:`.

?`cxx/Macros.*xx`:
	?`macrosNoUniqueAddressTest`: is now `static`, move into `cxx/Macros.cxx`.
	+`macroTestsNoexcept`: has macro tests which were in `testHarnesses`, calls `macrosNoUniqueAddressTest`.

?`cxx/main.cxx`: ?`testHarnesses`:
  now calls `macroTestsNoexcept`.
  was `[[noreturn]]`, now has `return 0;`.

?`build.sh`: compile `cxx/Macros.cxx` into `Macros.o`, link `Macros.o` into `a.out`.

?`posts/VirusAnalysis.md`: include all this, except 100 lines of: unused OSC `sh` commands + disabled colors.

Is progress to issue #14 .

Is followup to bdfb817 (?`cxx/Macros`: +`macrosNoUniqueAddressTest()`:) c23165a (Prefix `SUSUWU_` to macros) 7dcf2bc (...test `NOEXCEPT(condition)`.) ce649ab
(?cxx/Macros.hxx `clang-tidy` fixes).
SwuduSusuwu added a commit that referenced this issue Nov 10, 2024
	Refactor, cleanup, misc fixes:
	Move `#include`'s to top (thus `namespace Susuwu {}` doesn't contain `#include`):
		?`macrosNoUniqueAddressTest`: separate from `SUSUWU_CXX20`,
		?`SUSUWU_CXX*`: move to top (due to `#include`),
	terminate English sentences (but not acronyms or source code) in comments with `.`,
	move `NOLINTBEGIN` out of `#if` block (it was in the block since the first diagnostic which it silences is in the block, but `NOLINTEND` isn't in the block),
	group `#define __WIN32__` close to `#define __POSIX_SOURCE`,
	remove extra `#define __POSIX_SOURCE`,
	?`SUSUWU_PRAGMA`, ?`SUSUWU_SH_ST`: comment has English fix,
	?`SUSUWU_SH_RUNTIME_COLORS`, ?`SUSUWU_SH_RUNTIME_OSC`: upgrade `#pragma message` (for early users) from `Notice:` to `Info:`.

?`cxx/Macros.*xx`:
	?`macrosNoUniqueAddressTest`: is now `static`, move into `cxx/Macros.cxx`.
	+`macroTestsNoexcept`: has macro tests which were in `testHarnesses`, calls `macrosNoUniqueAddressTest`.

?`cxx/main.cxx`: ?`testHarnesses`:
  now calls `macroTestsNoexcept`.
  was `[[noreturn]]`, now has `return 0;`.

?`build.sh`: compile `cxx/Macros.cxx` into `Macros.o`, link `Macros.o` into `a.out`.

?`posts/VirusAnalysis.md`: include all this, except 100 lines of: unused OSC `sh` commands + disabled colors.

Is progress to issue #14 .

Is followup to bdfb817 (?`cxx/Macros`: +`macrosNoUniqueAddressTest()`:) c23165a (Prefix `SUSUWU_` to macros) 7dcf2bc (...test `NOEXCEPT(condition)`.) ce649ab
(?cxx/Macros.hxx `clang-tidy` fixes).
SwuduSusuwu added a commit that referenced this issue Nov 10, 2024
	Refactor, cleanup, misc fixes:
	Move `#include`'s to top (thus `namespace Susuwu {}` doesn't contain `#include`):
		?`macrosNoUniqueAddressTest`: separate from `SUSUWU_CXX20`,
		?`SUSUWU_CXX*`: move to top (due to `#include`),
	terminate English sentences (but not acronyms or source code) in comments with `.`,
	move `NOLINTBEGIN` out of `#if` block (it was in the block since the first diagnostic which it silences is in the block, but `NOLINTEND` isn't in the block),
	group `#define __WIN32__` close to `#define __POSIX_SOURCE`,
	remove extra `#define __POSIX_SOURCE`,
	?`SUSUWU_PRAGMA`, ?`SUSUWU_SH_ST`: comment has English fix,
	?`SUSUWU_SH_RUNTIME_COLORS`, ?`SUSUWU_SH_RUNTIME_OSC`: upgrade `#pragma message` (for early users) from `Notice:` to `Info:`.
	?`SUSUWU_UNREACHABLE`: "warning: found assert() that could be replaced by static_assert() [cert-dcl03-c,hicpp-static-assert,misc-static-assert]": suppress (can not use `static_assert` for this).

?`cxx/Macros.*xx`:
	?`macrosNoUniqueAddressTest`: is now `static`, move into `cxx/Macros.cxx`.
	+`macroTestsNoexcept`: has macro tests which were in `testHarnesses`, calls `macrosNoUniqueAddressTest`.

?`cxx/main.cxx`: ?`testHarnesses`:
	now calls `macroTestsNoexcept`.
	was `[[noreturn]]`, now has `return 0;`.
	comment purpose of `std::flush`.

?`build.sh`: compile `cxx/Macros.cxx` into `Macros.o`, link `Macros.o` into `a.out`.

?`posts/VirusAnalysis.md`: include all this, except 100 lines of: unused OSC `sh` commands + disabled colors.

Is progress to issue #14 .

Is followup to bdfb817 (?`cxx/Macros`: +`macrosNoUniqueAddressTest()`:) c23165a (Prefix `SUSUWU_` to macros) 7dcf2bc (...test `NOEXCEPT(condition)`.) ce649ab
(?cxx/Macros.hxx `clang-tidy` fixes).
@SwuduSusuwu
Copy link
Owner Author

SwuduSusuwu commented Nov 10, 2024

Ignore 3c9a321 abe00f8 bbb4a8a; those were from a local branch (not supposed to commit.)

SwuduSusuwu added a commit that referenced this issue Nov 11, 2024
	unit tests.

?`cxx/main.cxx`:
	`%s/testHarnesses/unitTestsCxx/`
	?`unitTestsCxx`:
		Use `expects`, `ensures`, `noexcept`.
		Process unit test return values, return the bitmask of all unit test return values. [Notice: Before this, `0` was always the return value.]
		TODO: execute `a.out` in `build.sh` (so that _GitHub_ runners will perform unit tests; if `a.out` returns a non-zero value, the value will show which tests to fix.) [Notice: this will cause _GitHub_ to post that the compilation failed (unless all unit tests pass,) thus have not done so in this commit.]

?`cxx/main.*xx`:
	+`susuwuUnitTests`: is `extern "C" {` wrap for `Susuwu::unitTestsCxx`, to support more languages.
	?`main`: put in `extern "C" {`.

?`build.sh`:
	Now executes unit tests, with `std::cerr` outputs.
	Now has (although commented-out) support to pass through unit test return values.

?`README.md`: howto interpret `a.out` return values.

?`SECURITY.md`:
	`%s/testHarnesses/susuwuUnitTests/`: thus doesn't assume that just C++ projects will use this.
	Text is now clickable.

?`posts/VirusAnalysis`: include what's new.

Is followup to 7dbb0db (+`cxx/Macros.cxx`: Unit tests. ?`cxx/Macros.hxx`:), 388affe (?`cxx/main.cxx`:`testHarnesses` test `classSysGetInput()`, don't reenable input if it was off.), 1ca8d4d (...?cxx/main.cxx:?main /* Store {argc, args} through classSysInit; now other functions can process as {classSysArgc, classSysArgs} */), d3dd3e3 (?cxx/main.cxx:testHarnesses /* Pass funcName to templateMatchAll */)

Is progress to issues #3, #14.
SwuduSusuwu added a commit that referenced this issue Nov 11, 2024
	unit tests.

?`cxx/main.cxx`:
	`%s/testHarnesses/unitTestsCxx/`
	?`unitTestsCxx`:
		Use `expects`, `ensures`, `noexcept`.
		Process unit test return values, return the bitmask of all unit test return values. [Notice: Before this, `0` was always the return value.]
		TODO: execute `a.out` in `build.sh` (so that _GitHub_ runners will perform unit tests; if `a.out` returns a non-zero value, the value will show which tests to fix.) [Notice: this will cause _GitHub_ to post that the compilation failed (unless all unit tests pass,) thus have not done so in this commit.]

?`cxx/main.*xx`:
	+`susuwuUnitTests`: is `extern "C" {` wrap for `Susuwu::unitTestsCxx`, to support more languages.
	?`main`: put in `extern "C" {`.

?`build.sh`:
	Now executes unit tests, with `std::cerr` outputs.
	Now has (although commented-out) support to pass through unit test return values.

?`README.md`: howto interpret `a.out` return values.

?`SECURITY.md`:
	`%s/testHarnesses/susuwuUnitTests/`: thus doesn't assume that just C++ projects will use this.
	Text is now clickable.

?`posts/VirusAnalysis`: include what's new.

Is followup to 7dbb0db (+`cxx/Macros.cxx`: Unit tests. ?`cxx/Macros.hxx`:), 388affe (?`cxx/main.cxx`:`testHarnesses` test `classSysGetInput()`, don't reenable input if it was off.), 1ca8d4d (...?cxx/main.cxx:?main /* Store {argc, args} through classSysInit; now other functions can process as {classSysArgc, classSysArgs} */), d3dd3e3 (?cxx/main.cxx:testHarnesses /* Pass funcName to templateMatchAll */)

Is progress to issues #3, #14.
SwuduSusuwu added a commit that referenced this issue Nov 12, 2024
	so it doesn't omit leading "0"s. `%s/char ch/unsigned char ch/`: fix output corruption on platforms with signed `char` (such as _GitHub_/_Ubuntu_). Store old: flags, fill width, fill char; restore old values.
	?`classSysHexStr`: assert that size of output is size of input * 2.
	?`cxx/ClassSys.hxx`: is `classSysHexOs`, `classSysHexStr`.
?`cxx/ClassSys.cxx`:
	`classSysTests`: test `classSysHexOs`, `classSysHexStr`.
	`#include "ClassSys.hxx"`: comment fix.
?`cxx/ClassSha2.cxx`: ?`hashStrTrue`: 2 hexits per char for test value (with above, fixes GitHub/Ubuntu unit tests).

?`cxx/ClassSys.hxx`, ?`cxx/ClassSys.cxx`: ?`execvesFork`,?`execvexFork`: +`SUSUWU_NOEXCEPT`: `%s/throw std::runtime_error();/return -1;/`

?`posts/VirusAnalysis.md`: include all this.

?`build.sh`: process `a.out` return value; GitHub now says that build failed unless unit tests pass.

Is followup to: 7a9f52b (+`cxx/main.hxx`: for issues #3, #14: cross-language unit tests)
SwuduSusuwu added a commit that referenced this issue Nov 12, 2024
	+`classResultListTestsNoexcept()`: tests `listDumpTo`, `resultListDumpTo` /* TODO: test most of `ClassResultList*` (issue #14) */
?`cxx/ClassResultList.hxx`:
	+`classResultListTests()`, +`classResultListTestsNoexcept()`.
	-`#include "Macros.hxx"`: was in middle of file, unused.
	+`#include "Macros.hxx"`: (at top) for `SUSUWU_PREFER_C` to set `SUSUWU_PREFER_CSTR`.
	?`classListDumpTo`:
		`%s/=>/=/`: now produces initialization list format.
		?`if(index)`: now produces "=" even if `pascalValues` is used.
		?`if(pascalValues)`: since `std::cout` converts the (constant-length) `size_t` Pascal-prefix to (variable-length) decimal, produce ":" to terminate the Pascal-prefix -- with a note to fix this to produce actual Pascal values.
Is followup to: c339b90 (?resultListDumpTo() ?listDumpTo() /*Template `os` to allow custom log outputs*/).

?`cxx/main.hxx`: +`susuwuUnitTestsClassResultListTestsBit`.
?`cxx/main.cxx`: `unitTestsCxx`: test `classResultListTestsNoexcept()`.
Is followup to:
7a9f52b (... #14: cross-language unit tests. ?`cxx/main.cxx`: ?`unitTestsCxx`: ... Process unit test return values, return the bitmask of all unit test return values.)

?`posts/VirusAnalysis.md`: include all this.
@SwuduSusuwu SwuduSusuwu added the todo unimplemented (but advertised) part of the tool label Nov 25, 2024
@SwuduSusuwu SwuduSusuwu changed the title testHarnesses() tests ~72% of executable routes (half coverage), must do >92% to have value Susuwu::unitTestsCxx tests ~72% of executable routes (half coverage), must do >92% to have value Nov 25, 2024
SwuduSusuwu added a commit that referenced this issue Nov 28, 2024
Is followup to: commit 940915427d5a86c347a973fea4f9b73c9cc37ef9 (?`cxx/ClassObject.hxx`: +`SUSUWU_VIRTUAL_DEFAULTS), the first commit with known good {`Class`, `Object`} operators.
Has to do with issues: #10 (Java port), #14 (more unit tests).
?`cxx/ClassObject.*xx`:
	+`classObjectTestValid()`, +`classObjectTestCommutative()`, +`classObjectTestMatch()`, +`classObjectTestMismatch()`; helper functions for `classObjectTests()`.
	+`classObjectTests()`; tests {`Class`, `Object`}::{`getObjectSize`, `getName`, `operator==`, `operator!=`, `hasImplementation`, `isInitialized`}.
	+`classObjectTestsNoexcept()`; `templateCatchAll` wrap for `classObjectTests()`.

?`build.sh`: ?`FLAGS_SPECIAL`:
	+`-DSUSUWU_VIRTUAL_VTABLE_COMPARISON`; "Error: classObjectTestMatch() { if(class1->operator!=(*class2 /*Susuwu::Object*/)) { /* `Susuwu::Object::operator!=` false negative. */ } }]" workaround. TODO: fix without workaround.

?`cxx/main.hxx`:
	+`susuwuUnitTestsClassObjectBit`; indicates error in `classSysObjectTests()`.
?`cxx/main.cxx`:
	?`unitTestsCxx`; test `classSysObjectTests()`.

?`posts/VirusAnalysis.md`: include `cxx/main.*xx`; the virtuals (from `cxx/ClassObjects.hxx`) are not used enough to include.
SwuduSusuwu added a commit that referenced this issue Dec 6, 2024
	Is followup to: commit 9a3a950b3590e51632eb8c813f82a3b5ca241e31 (`Object`->{+`Instrumentation`,@`Object`}; @`Class`,), the first commit with known good {`Class`, `Object`} operators.
	Has to do with issues: #10 (Java port), #14 (more unit tests).

@`cxx/ClassObject.hxx`: +`classObjectTests()`, +`classObjectTestsNoexcept()`: forward declarations.
+`cxx/ClassObject.cxx`:
	+`classIsValid()`: tests `Class::isInitialized()`, `Class::isInstance()`, `Class:isPureVirtual()`.
	+`classTestsCommutative()`: tests `instanceof`, `Class::isInstance()`. `Class::isRelatedTo()`, `Class::operator==()`, `Class::operator!=`.
	+`classTestsMatch()`: tests `Class::getObjectSize()`, `Class::isRelatedTo()`, `Class::operator!=()`.
	+`classTestsMismatch()`: tests `Class::getName`, `Class::isInstance()`, `Class::operator==()`
	+`classObjectTests()`; tests {`Class`, `Object`, `class SubClass : public Class {}`, ...} through {`classIsValid()`, `classTestsCommutative()`, `classTestsMatch()`, `classTestsMismatch()`}.
	+`classObjectTestsNoexcept()`; `templateCatchAll` wrap for `classObjectTests()`.

@`cxx/main.hxx`:
	@`susuwuUnitTestsClassConsoleBit`; comment fixup.
	+`susuwuUnitTestsClassObjectBit`; indicates error in `classSysObjectTests()`.
	@`susuwuUnitTestsClass*Bit`; renumber (due to insertion of `susuwuUnitTestsClassObjectBit`.)
@`cxx/main.cxx`:
	@`unitTestsCxx`; test `classSysObjectTests()`.

@`posts/VirusAnalysis.md`:
	Reminder to update `SECURITY.md` with new line numbersxcvbnsdc; Is followup to: commit f672023 (@`README.md`, @`SECURITY.md`: local path use,); forgot to include this.
	Include `cxx/main.*xx`, include `cxx/ClassObjects.hxx`. (`cxx/ClassObjects.cxx` is another 200 lines of unit tests, which could distract from code which has use.)
SwuduSusuwu added a commit that referenced this issue Dec 6, 2024
	`clone()`, `equals()`, `hashCode()`, `toString()`.
	Is followup to: commit 41a37564dad036ba57acd2392dbe1001874e7977 (+`cxx/ClassObject.cxx`: unit test `Class::` funcs.). TODO: squash this commit into that, unless -- as a separate commit shows how to add new tests -- this has historical value.
	Is progress to issues: #10 (Java port), #14 (unit tests).

@`cxx/ClassObject.cxx`:
	+`objectIsValid()`; for now, just tests `Object::clone()` && `classIsValid()`.
	+`objectTestsCommutative()`; invariant tests (common to `objectTestsMatch()` & `objectTestsMismatch()`).
	+`objectTestsMatch()`; as `classTestsMatch()` tests `Class::`, this tests `Object::`.
	+`objectTestsMismatch()`; as `classTestsMismatch()` tests `Class::`, this tests `!Object::`.
	@`clasObjectTests()`:
		Test `objectTestsMatch()`, `objectTestsMismatch()`, `SUSUWU_VIRTUAL_EQUALS_USE_ADDRESSES`.
SwuduSusuwu added a commit that referenced this issue Dec 6, 2024
	Is followup to: commit 5a9de2e (`Object`->{+`Instrumentation`,@`Object`}, @`Class`,), the first commit with known good {`Class`, `Object`} operators.
	Has to do with issues: #10 (Java port), #14 (more unit tests).

@`cxx/ClassObject.hxx`: +`classObjectTests()`, +`classObjectTestsNoexcept()`: forward declarations.
+`cxx/ClassObject.cxx`:
	+`classIsValid()`: tests `Class::isInitialized()`, `Class::isInstance()`, `Class:isPureVirtual()`.
	+`classTestsCommutative()`: tests `instanceof`, `Class::isInstance()`. `Class::isRelatedTo()`, `Class::operator==()`, `Class::operator!=`.
	+`classTestsMatch()`: tests `Class::getObjectSize()`, `Class::isRelatedTo()`, `Class::operator!=()`.
	+`classTestsMismatch()`: tests `Class::getName`, `Class::isInstance()`, `Class::operator==()`
	+`classObjectTests()`; tests {`Class`, `Object`, `class SubClass : public Class {}`, ...} through {`classIsValid()`, `classTestsCommutative()`, `classTestsMatch()`, `classTestsMismatch()`}.
	+`classObjectTestsNoexcept()`; `templateCatchAll` wrap for `classObjectTests()`.

@`cxx/main.hxx`:
	@`susuwuUnitTestsClassConsoleBit`; comment fixup.
	+`susuwuUnitTestsClassObjectBit`; indicates error in `classSysObjectTests()`.
	@`susuwuUnitTestsClass*Bit`; renumber (due to insertion of `susuwuUnitTestsClassObjectBit`.)
@`cxx/main.cxx`:
	@`unitTestsCxx`; test `classSysObjectTests()`.

@`posts/VirusAnalysis.md`:
	Include `cxx/main.*xx`, include `cxx/ClassObjects.hxx`. (`cxx/ClassObjects.cxx` is another 200 lines of unit tests, which could distract from code which has use.)
SwuduSusuwu added a commit that referenced this issue Dec 6, 2024
	`clone()`, `equals()`, `hashCode()`, `toString()`.
	Is followup to: commit 07e38cf (+`cxx/ClassObject.cxx`: unit test `Class::` funcs.). TODO: squash this commit into that, unless -- as a separate commit shows how to add new tests -- this has historical value.
	Is progress to issues: #10 (Java port), #14 (unit tests).

@`cxx/ClassObject.cxx`:
	+`objectIsValid()`; for now, just tests `Object::clone()` && `classIsValid()`.
	+`objectTestsCommutative()`; invariant tests (common to `objectTestsMatch()` & `objectTestsMismatch()`).
	+`objectTestsMatch()`; as `classTestsMatch()` tests `Class::`, this tests `Object::`.
	+`objectTestsMismatch()`; as `classTestsMismatch()` tests `Class::`, this tests `!Object::`.
	@`clasObjectTests()`:
		Test `objectTestsMatch()`, `objectTestsMismatch()`, `SUSUWU_VIRTUAL_EQUALS_USE_ADDRESSES`.
@SwuduSusuwu
Copy link
Owner Author

758cd85 through bf491d4 were drafts from the experimental branch; replaced with 07e38cf, 65f10b6

SwuduSusuwu referenced this issue Dec 16, 2024
	instructions for "Environment flags" improved.

@`cxx/Macros.hxx`: +`SUSUWU_UNIT_TESTS`; default = `true`.
	If set to `false`; compilation time, object size, executable size reduced (to around half).
@`cxx/main.cxx`: @`unitTestsCxx()`; `#if SUSUWU_UNIT_TESTS` do tests, `#else` print notice.
@`cxx/*.*xx`:
	`*Tests()`, `*TestsNoexcept()`; wrap with `#if SUSUWU_UNIT_TESTS`

@`posts/VirusAnalysis.md`:
	Include this.
	Remove mismatched `};`. Is followup to: commit 043d89a (... @`cxx/ClassSys.cxx`: anonymous namespace for 'classSysHexTests',).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers improve New feature or request todo unimplemented (but advertised) part of the tool
Projects
None yet
Development

No branches or pull requests

1 participant