Repository: Konstantin8105/c4go
Pull request #277 (2019-02-22 10:24:41)

add types for operation  Not

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=h1) Report
> Merging [#277](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/0a5ec2b2657a24c8505385c77325e016c83bf8a6?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `50%`.

[![Impacted file tree graph](https://codecov.io/gh/Konstantin8105/c4go/pull/277/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
- Coverage   86.81%   86.78%   -0.04%     
==========================================
  Files         180      180              
  Lines        9781     9789       +8     
==========================================
+ Hits         8491     8495       +4     
- Misses        892      894       +2     
- Partials      398      400       +2
```


| [Impacted Files](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [noarch/noarch.go](https://codecov.io/gh/Konstantin8105/c4go/pull/277/diff?src=pr&el=tree#diff-bm9hcmNoL25vYXJjaC5nbw==) | `66.66% <50%> (-8.34%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=footer). Last update [0a5ec2b...250e31f](https://codecov.io/gh/Konstantin8105/c4go/pull/277?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/noarch/noarch.go b/noarch/noarch.go
index 009017b..97e8b92 100644
--- a/noarch/noarch.go
+++ b/noarch/noarch.go
@@ -20,6 +20,15 @@ func NotInt(x int) int {
 	return 0
 }
 
+// NotInt32 performs a logical not (!) on an integer and returns an integer.
+func NotInt32(x int32) int {
+	if x == 0 {
+		return 1
+	}
+
+	return 0
+}
+
 // NotUint16 performs a logical not (!) on an integer and returns an integer.
 func NotUint16(x uint16) int {
 	if x == 0 {
@@ -37,3 +46,12 @@ func NotUint32(x uint32) int {
 
 	return 0
 }
+
+// NotByte performs a logical not (!) on an integer and returns an integer.
+func NotByte(x byte) int {
+	if x == 0 {
+		return 1
+	}
+
+	return 0
+}


Test patch:
diff --git a/tests/cast.c b/tests/cast.c
index 6539e6a..2d0e3e6 100644
--- a/tests/cast.c
+++ b/tests/cast.c
@@ -142,7 +142,7 @@ void test_unsafe_pnt()
 
 int main()
 {
-    plan(34);
+    plan(36);
 
 	START_TEST(unsafe_pnt);
     START_TEST(bool_to_int);
@@ -244,6 +244,20 @@ int main()
             pass("unsigned long to bool")
         }
     }
+	diag("char to bool");
+	{
+        char c = 2;
+        if (!(!(c))) {
+            pass("char to bool")
+        }
+	}
+	diag("long to bool");
+	{
+        long c = 2;
+        if (!(!(c))) {
+            pass("long to bool")
+        }
+	}
 
     char_overflow();