Git Product home page Git Product logo

Comments (19)

orangeduck avatar orangeduck commented on July 18, 2024

This should be important for a more solid fix to #37

from cello.

codyrioux avatar codyrioux commented on July 18, 2024

Hey, just checking in on the changes in a5b51f8 and here are the results of running make check. Note that make builds cleanly.

$ make check
gcc tests/core.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/core.o
gcc tests/data.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/data.o
gcc tests/exceptions.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/exceptions.o
gcc tests/functional.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/functional.o
tests/functional.c: In function ‘test_stack_function’:
tests/functional.c:12: error: incompatible types in initialization
tests/functional.c: In function ‘test_call’:
tests/functional.c:56: error: incompatible types in initialization
tests/functional.c:57: error: incompatible types in initialization
tests/functional.c: In function ‘test_call_with’:
tests/functional.c:74: error: incompatible types in initialization
tests/functional.c: In function ‘test_call_with_ptr’:
tests/functional.c:88: error: incompatible types in initialization
cc1: warnings being treated as errors
tests/functional.c: In function ‘test_lambda’:
tests/functional.c:100: warning: dereferencing ‘void *’ pointer
tests/functional.c:100: error: request for member ‘func’ in something not a structure or union
tests/functional.c:107: error: expected ‘;’ before ‘call_with_ptr’
tests/functional.c: In function ‘test_lambda_id’:
tests/functional.c:116: warning: dereferencing ‘void *’ pointer
tests/functional.c:116: error: request for member ‘func’ in something not a structure or union
tests/functional.c:120: error: expected ‘;’ before ‘var’
tests/functional.c:120: error: ‘return_new_int2’ undeclared (first use in this function)
tests/functional.c:120: error: (Each undeclared identifier is reported only once
tests/functional.c:120: error: for each function it appears in.)
tests/functional.c: In function ‘test_lambda_const’:
tests/functional.c:136: warning: dereferencing ‘void *’ pointer
tests/functional.c:136: error: request for member ‘func’ in something not a structure or union
tests/functional.c: In function ‘test_lambda_compose’:
tests/functional.c:146: warning: dereferencing ‘void *’ pointer
tests/functional.c:146: error: request for member ‘func’ in something not a structure or union
tests/functional.c:150: error: expected ‘;’ before ‘var’
tests/functional.c:150: error: ‘return_arg0’ undeclared (first use in this function)
tests/functional.c:156: error: expected ‘;’ before ‘var’
tests/functional.c:156: error: ‘return_compose’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_flip’:
tests/functional.c:166: warning: dereferencing ‘void *’ pointer
tests/functional.c:166: error: request for member ‘func’ in something not a structure or union
tests/functional.c:170: error: expected ‘;’ before ‘var’
tests/functional.c:170: error: ‘return_first_flip’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_pipe’:
tests/functional.c:187: warning: dereferencing ‘void *’ pointer
tests/functional.c:187: error: request for member ‘func’ in something not a structure or union
tests/functional.c:192: error: expected ‘;’ before ‘var’
tests/functional.c:192: error: ‘add_ten’ undeclared (first use in this function)
tests/functional.c:197: error: expected ‘;’ before ‘var’
tests/functional.c:197: error: ‘add_hundred’ undeclared (first use in this function)
tests/functional.c:202: error: expected ‘;’ before ‘var’
tests/functional.c:202: error: ‘add_all’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_method_pipe’:
tests/functional.c:214: warning: dereferencing ‘void *’ pointer
tests/functional.c:214: error: request for member ‘func’ in something not a structure or union
tests/functional.c:219: error: expected ‘;’ before ‘var’
tests/functional.c:219: error: ‘cat_buzz’ undeclared (first use in this function)
tests/functional.c:224: error: expected ‘;’ before ‘var’
tests/functional.c:224: error: ‘cat_boo’ undeclared (first use in this function)
tests/functional.c:229: error: expected ‘;’ before ‘var’
tests/functional.c:229: error: ‘cat_all’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_partial_l’:
tests/functional.c:241: warning: dereferencing ‘void *’ pointer
tests/functional.c:241: error: request for member ‘func’ in something not a structure or union
tests/functional.c:248: error: expected ‘;’ before ‘var’
tests/functional.c:250: warning: dereferencing ‘void *’ pointer
tests/functional.c:250: error: request for member ‘func’ in something not a structure or union
tests/functional.c: In function ‘__suite_functional_block_invoke_19’:
tests/functional.c:250: error: ‘total’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_partial_l’:
tests/functional.c:254: error: ‘total’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_partial_r’:
tests/functional.c:259: warning: dereferencing ‘void *’ pointer
tests/functional.c:259: error: request for member ‘func’ in something not a structure or union
tests/functional.c:266: error: expected ‘;’ before ‘var’
tests/functional.c:268: warning: dereferencing ‘void *’ pointer
tests/functional.c:268: error: request for member ‘func’ in something not a structure or union
tests/functional.c: In function ‘__suite_functional_block_invoke_21’:
tests/functional.c:268: error: ‘total’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_partial_r’:
tests/functional.c:272: error: ‘total’ undeclared (first use in this function)
tests/functional.c: In function ‘test_lambda_uncurry’:
tests/functional.c:282: warning: dereferencing ‘void *’ pointer
tests/functional.c:282: error: request for member ‘func’ in something not a structure or union
tests/functional.c: In function ‘test_lambda_void_uncurry’:
tests/functional.c:296: warning: dereferencing ‘void *’ pointer
tests/functional.c:296: error: request for member ‘func’ in something not a structure or union
tests/functional.c: In function ‘test_map’:
tests/functional.c:309: warning: dereferencing ‘void *’ pointer
tests/functional.c:309: error: request for member ‘func’ in something not a structure or union
tests/functional.c:314: error: expected ‘;’ before ‘var’
tests/functional.c:316: error: ‘values’ undeclared (first use in this function)
tests/functional.c: In function ‘test_new_map’:
tests/functional.c:328: warning: dereferencing ‘void *’ pointer
tests/functional.c:328: error: request for member ‘func’ in something not a structure or union
tests/functional.c:332: error: expected ‘;’ before ‘var’
tests/functional.c:334: error: ‘values’ undeclared (first use in this function)
tests/functional.c: In function ‘test_new_filter’:
tests/functional.c:346: warning: dereferencing ‘void *’ pointer
tests/functional.c:346: error: request for member ‘func’ in something not a structure or union
tests/functional.c:350: error: expected ‘;’ before ‘var’
tests/functional.c:351: error: ‘values’ undeclared (first use in this function)
tests/functional.c: In function ‘test_new_foldl’:
tests/functional.c:386: warning: dereferencing ‘void *’ pointer
tests/functional.c:386: error: request for member ‘func’ in something not a structure or union
tests/functional.c:393: error: expected ‘;’ before ‘var’
tests/functional.c:394: error: ‘values’ undeclared (first use in this function)
tests/functional.c: In function ‘test_new_foldr’:
tests/functional.c:405: warning: dereferencing ‘void *’ pointer
tests/functional.c:405: error: request for member ‘func’ in something not a structure or union
tests/functional.c:412: error: expected ‘;’ before ‘var’
tests/functional.c:413: error: ‘values’ undeclared (first use in this function)
make: *** [obj/functional.o] Error 1

I don't currently have time to look at it, but I thought I would post this up in case anyone had a chance to look at it.

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Hey, you can see if this is (at least mainly) fixed in e7cf498, otherwise I will wait till I get access to a mac. Thanks again for the help testing :)

from cello.

novabyte avatar novabyte commented on July 18, 2024

@orangeduck I'm happy to test this. Are there unit tests I can run? or a script I can try?

from cello.

novabyte avatar novabyte commented on July 18, 2024

btw, running make:

$ make
mkdir obj
gcc src/Array.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Array.o
gcc src/Bool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Bool.o
gcc src/Char.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Char.o
gcc src/Dictionary.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Dictionary.o
gcc src/Exception.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Exception.o
gcc src/File.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/File.o
gcc src/Format.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Format.o
gcc src/Function.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Function.o
gcc src/Lambda.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Lambda.o
gcc src/List.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/List.o
gcc src/Map.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Map.o
gcc src/Number.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Number.o
gcc src/Pool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Pool.o
gcc src/Prelude.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Prelude.o
gcc src/Reference.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Reference.o
gcc src/String.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/String.o
gcc src/Table.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Table.o
gcc src/Thread.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Thread.o
gcc src/Tree.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Tree.o
gcc src/Type.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Type.o
gcc obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o -shared -g -o libCello.so
ar rcs libCello.a obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o

More information on the generated libraries:

$ file libCello.a 
libCello.a: current ar archive random library

$ file libCello.so 
libCello.so: Mach-O 64-bit dynamically linked shared library x86_64

$ otool -L libCello.so 
libCello.so:
    libCello.so (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

My system details:

$ uname -a
Darwin novabyte 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64

from cello.

novabyte avatar novabyte commented on July 18, 2024

I'm running make check (just seen the makefile contents in more detail) on commit e7cf498 (from master):

$ make check
gcc tests/core.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/core.o
gcc tests/data.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/data.o
gcc tests/exceptions.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/exceptions.o
gcc tests/functional.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/functional.o
gcc tests/memory.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/memory.o
gcc tests/ptest.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/ptest.o
gcc tests/test.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/test.o
gcc tests/threading.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/threading.o
tests/threading.c: In function ‘__suite_threading_block_invoke_1’:
tests/threading.c:29: error: assignment of read-only variable ‘in_func’
make: *** [obj/threading.o] Error 1

With gcc --version:

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

from cello.

codyrioux avatar codyrioux commented on July 18, 2024

Confirmed I am getting the same output as @novabyte with e7cf498

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Thanks this seems like good news. Perhaps you can try changing lines 26-38 of threading.c to this:

    var in_func = $(Reference, False);

    lambda(f, args) {
      set(in_func, 0, True);
      return None;
    };

    var t = new(Thread, f);

    PT_ASSERT(not at(in_func, 0));
    call(t, None);
    join(t);
    PT_ASSERT(at(in_func, 0));

from cello.

novabyte avatar novabyte commented on July 18, 2024

From git diff:

$ git diff
diff --git a/tests/threading.c b/tests/threading.c
index 3bd692b..f80687a 100644
--- a/tests/threading.c
+++ b/tests/threading.c
@@ -23,19 +23,19 @@ PT_SUITE(suite_threading) {

   PT_TEST(test_new) {

-    bool in_func = false;
-    
+    var in_func = $(Reference, False);
+
     lambda(f, args) {
-      in_func = true;
+      set(in_func, 0, True);
       return None;
     };
-    
+
     var t = new(Thread, f);
-    
-    PT_ASSERT(not in_func);
+
+    PT_ASSERT(not at(in_func, 0));
     call(t, None);
     join(t);
-    PT_ASSERT(in_func);
+    PT_ASSERT(at(in_func, 0));

     delete(t);

Hopefully I made the above change in the right place. Running make check:

$ make check
gcc tests/core.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/core.o
gcc tests/data.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/data.o
gcc tests/exceptions.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/exceptions.o
gcc tests/functional.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/functional.o
gcc tests/memory.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/memory.o
gcc tests/ptest.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/ptest.o
gcc tests/test.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/test.o
gcc tests/threading.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/threading.o
gcc src/Array.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Array.o
gcc src/Bool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Bool.o
gcc src/Char.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Char.o
gcc src/Dictionary.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Dictionary.o
gcc src/Exception.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Exception.o
gcc src/File.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/File.o
gcc src/Format.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Format.o
gcc src/Function.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Function.o
gcc src/Lambda.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Lambda.o
gcc src/List.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/List.o
gcc src/Map.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Map.o
gcc src/Number.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Number.o
gcc src/Pool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Pool.o
gcc src/Prelude.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Prelude.o
gcc src/Reference.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Reference.o
gcc src/String.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/String.o
gcc src/Table.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Table.o
gcc src/Thread.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Thread.o
gcc src/Tree.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Tree.o
gcc src/Type.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Type.o
ar rcs libCello.a obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o
gcc obj/core.o obj/data.o obj/exceptions.o obj/functional.o obj/memory.o obj/ptest.o obj/test.o obj/threading.o libCello.a -lpthread -lm -o test
./test

    +-------------------------------------------+
    | ptest          MicroTesting Magic for C   |
    |                                           |
    | Daniel Holden ([email protected]) |
    +-------------------------------------------+


  ===== Suite Core =====

    | Test Type ... Passed! 
    | Test Cast ... Passed! 
    | Test New ... Passed! 
    | Test Assign ... Passed! 
    | Test Copy ... Passed! 
    | Test Eq ... Passed! 
    | Test Ord ... Passed! 
    | Test Hash ... Passed! 
    | Test Collection ... Passed! 
    | Test Iter ... Passed! 
    | Test Push ... Passed! 
    | Test At ... Passed! 
    | Test Dict ... Passed! 
    | Test As Ctype ... Passed! 
    | Test Stream ... Passed! 
    | Test Type New ... Passed! 
    | Test Type Implements ... Passed! 
    | Test Show ... Passed! 
    | Test Look ... Passed! 


  ===== Suite Functional =====

make: *** [check] Segmentation fault: 11

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Looks correct but will probably have to inspect the segfault in more depth when I can.

I may know the issue. If it is what I think it should pass tests if you comment out all the functional tests up until test_lambda. Otherwise I think time to call it a night. Thanks for the help :)

from cello.

novabyte avatar novabyte commented on July 18, 2024

I reckon go get some sleep :) but here's the result of the above changes plus commenting out up to test_lambda:

$ make check
gcc tests/core.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/core.o
gcc tests/data.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/data.o
gcc tests/exceptions.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/exceptions.o
gcc tests/functional.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/functional.o
gcc tests/memory.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/memory.o
gcc tests/ptest.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/ptest.o
gcc tests/test.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/test.o
gcc tests/threading.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/threading.o
gcc src/Array.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Array.o
gcc src/Bool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Bool.o
gcc src/Char.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Char.o
gcc src/Dictionary.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Dictionary.o
gcc src/Exception.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Exception.o
gcc src/File.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/File.o
gcc src/Format.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Format.o
gcc src/Function.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Function.o
gcc src/Lambda.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Lambda.o
gcc src/List.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/List.o
gcc src/Map.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Map.o
gcc src/Number.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Number.o
gcc src/Pool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Pool.o
gcc src/Prelude.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Prelude.o
gcc src/Reference.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Reference.o
gcc src/String.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/String.o
gcc src/Table.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Table.o
gcc src/Thread.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Thread.o
gcc src/Tree.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Tree.o
gcc src/Type.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Type.o
ar rcs libCello.a obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o
gcc obj/core.o obj/data.o obj/exceptions.o obj/functional.o obj/memory.o obj/ptest.o obj/test.o obj/threading.o libCello.a -lpthread -lm -o test
./test

    +-------------------------------------------+
    | ptest          MicroTesting Magic for C   |
    |                                           |
    | Daniel Holden ([email protected]) |
    +-------------------------------------------+


  ===== Suite Core =====

    | Test Type ... Passed! 
    | Test Cast ... Passed! 
    | Test New ... Passed! 
    | Test Assign ... Passed! 
    | Test Copy ... Passed! 
    | Test Eq ... Passed! 
    | Test Ord ... Passed! 
    | Test Hash ... Passed! 
    | Test Collection ... Passed! 
    | Test Iter ... Passed! 
    | Test Push ... Passed! 
    | Test At ... Passed! 
    | Test Dict ... Passed! 
    | Test As Ctype ... Passed! 
    | Test Stream ... Passed! 
    | Test Type New ... Passed! 
    | Test Type Implements ... Passed! 
    | Test Show ... Passed! 
    | Test Look ... Passed! 


  ===== Suite Functional =====

    | Test Lambda ... Passed! 
    | Test Lambda Id ... Passed! 
    | Test Lambda Const ... Passed! 
    | Test Lambda Compose ... Passed! 
    | Test Lambda Flip ... Passed! 
    | Test Lambda Pipe ... Passed! 
    | Test Lambda Method Pipe ... Passed! 
    | Test Lambda Partial L ... Passed! 
    | Test Lambda Partial R ... Passed! 
    | Test Lambda Uncurry ... Passed! 
    | Test Lambda Void Uncurry ... Passed! 
    | Test Map ... Passed! 
    | Test New Map ... Passed! 
    | Test New Filter ... Passed! 
    | Test New Sum ... Passed! 
    | Test New Product ... Passed! 
    | Test New Foldl ... Passed! 
    | Test New Foldr ... Passed! 


  ===== Suite Data =====

    | Test Bool Ord ... Passed! 
    | Test Bool Hash ... Passed! 
    | Test Bool Asctypes ... Passed! 
    | Test Char Create ... Passed! 
    | Test Char Ord ... Passed! 
    | Test Char Hash ... Passed! 
    | Test Int Create ... Passed! 
    | Test Int Ord ... Passed! 
    | Test Int Hash ... Passed! 
    | Test Int Num ... Passed! 
    | Test Int Parse ... Passed! 
    | Test Real Create ... Passed! 
    | Test Real Ord ... Passed! 
    | Test Real Hash ... Passed! 
    | Test Real Num ... Passed! 
    | Test Real Parse ... Passed! 
    | Test String Create ... Passed! 
    | Test String Ord ... Passed! 
    | Test String Collection ... Passed! 
    | Test String Hash ... Passed! 
    | Test String Reverse ... Passed! 
    | Test Array Create ... Passed! 
    | Test Array Eq ... Passed! 
    | Test Array Collection ... Passed! 
    | Test Array Push ... Passed! 
    | Test Array At ... Passed! 
    | Test Array Iter ... Passed! 
    | Test Array Reverse ... Passed! 
    | Test Table Create ... Passed! 
    | Test Table Collection ... Passed! 
    | Test Table Dict ... Passed! 
    | Test Table Iter ... Passed! 
    | Test Tree Create ... Passed! 
    | Test Tree Collection ... Passed! 
    | Test Tree Dict ... Passed! 
    | Test Tree Iter ... Passed! 
    | Test List Create ... Passed! 
    | Test List Eq ... Passed! 
    | Test List Collection ... Passed! 
    | Test List Push ... Passed! 
    | Test List At ... Passed! 
    | Test List Iter ... Passed! 
    | Test List Reverse ... Passed! 
    | Test Dictionary Create ... Passed! 
    | Test Dictionary Collection ... Passed! 
    | Test Dictionary Iter ... Passed! 
    | Test Dictionary Dict ... Passed! 
    | Test Map Create ... Passed! 
    | Test Map Collection ... Passed! 
    | Test Map Iter ... Passed! 
    | Test Map Dict ... Passed! 
    | Test File Create ... Passed! 
    | Test File Read ... Passed! 
    | Test File Dict ... Passed! 


  ===== Suite Exception =====

    | Test Throw ... Failed! 

        1. Assert [ Exception_Depth() is -1 ] (tests/exceptions.c:28)

    | Test Catch ... Failed! 

        1. Assert [ Exception_Depth() is -1 ] (tests/exceptions.c:60)

    | Test Catch All ... Failed! 

        1. Assert [ Exception_Depth() is -1 ] (tests/exceptions.c:83)

    | Test Catch Outer ... Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:94)
        2. Assert [ Exception_Depth() is 1 ] (tests/exceptions.c:97)
        3. Assert [ Exception_Depth() is -1 ] (tests/exceptions.c:112)



  ===== Suite Memory =====

    | Test New ... Passed! 
    | Test Reference ... Passed! 
    | Test Reference With ... Passed! 
    | Test Reference With Many ... Passed! 
    | Test Pool ... Passed! 


  ===== Suite Threading =====

    | Test New ... Passed! 
    | Test Multiple ... Passed! 
    | Test Mutex ... Passed! 
    | Test Exception ... Passed! 

  +---------------------------------------------------+
  |                      Summary                      |
  +---------++------------+-------------+-------------+
  | Suites  || Total    6 | Passed    5 | Failed    1 |
  | Tests   || Total  104 | Passed  100 | Failed    4 |
  | Asserts || Total  652 | Passed  646 | Failed    6 |
  +---------++------------+-------------+-------------+

      Total Running Time: 0.085s

I commented out lines 6-114.

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

This may be fixed in 59f72eb

from cello.

novabyte avatar novabyte commented on July 18, 2024

Morning 😃

I had to apply the code change you suggested I make in threading.c as above (I'm not sure if this shouldn't have been necessary). Once I'd done that running make check gives me:

$ make check
gcc tests/threading.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/threading.o
gcc src/Array.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Array.o
gcc src/Bool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Bool.o
gcc src/Char.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Char.o
gcc src/Dictionary.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Dictionary.o
gcc src/Exception.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Exception.o
gcc src/File.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/File.o
gcc src/Format.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Format.o
gcc src/Function.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Function.o
gcc src/Lambda.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Lambda.o
gcc src/List.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/List.o
gcc src/Map.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Map.o
gcc src/Number.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Number.o
gcc src/Pool.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Pool.o
gcc src/Prelude.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Prelude.o
gcc src/Reference.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Reference.o
gcc src/String.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/String.o
gcc src/Table.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Table.o
gcc src/Thread.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Thread.o
gcc src/Tree.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Tree.o
gcc src/Type.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/Type.o
ar rcs libCello.a obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o
gcc obj/core.o obj/data.o obj/exceptions.o obj/functional.o obj/memory.o obj/ptest.o obj/test.o obj/threading.o libCello.a -lpthread -lm -o test
./test

    +-------------------------------------------+
    | ptest          MicroTesting Magic for C   |
    |                                           |
    | Daniel Holden ([email protected]) |
    +-------------------------------------------+


  ===== Suite Core =====

    | Test Type ... Passed! 
    | Test Cast ... Passed! 
    | Test New ... Passed! 
    | Test Assign ... Passed! 
    | Test Copy ... Passed! 
    | Test Eq ... Passed! 
    | Test Ord ... Passed! 
    | Test Hash ... Passed! 
    | Test Collection ... Passed! 
    | Test Iter ... Passed! 
    | Test Push ... Passed! 
    | Test At ... Passed! 
    | Test Dict ... Passed! 
    | Test As Ctype ... Passed! 
    | Test Stream ... Passed! 
    | Test Type New ... Passed! 
    | Test Type Implements ... Passed! 
    | Test Show ... Passed! 
    | Test Look ... Passed! 


  ===== Suite Functional =====

    | Test Stack Function ... Passed! 
    | Test Heap Function ... Passed! 
    | Test Function Assign ... Passed! 
    | Test Function Copy ... Passed! 
    | Test Call ... Passed! 
    | Test Call With ... Passed! 
    | Test Call With Ptr ... Passed! 
    | Test Lambda ... Passed! 
    | Test Lambda Id ... Passed! 
    | Test Lambda Const ... Passed! 
    | Test Lambda Compose ... Passed! 
    | Test Lambda Flip ... Passed! 
    | Test Lambda Pipe ... Passed! 
    | Test Lambda Method Pipe ... Passed! 
    | Test Lambda Partial L ... Passed! 
    | Test Lambda Partial R ... Passed! 
    | Test Lambda Uncurry ... Passed! 
    | Test Lambda Void Uncurry ... Passed! 
    | Test Map ... Passed! 
    | Test New Map ... Passed! 
    | Test New Filter ... Passed! 
    | Test New Sum ... Passed! 
    | Test New Product ... Passed! 
    | Test New Foldl ... Passed! 
    | Test New Foldr ... Passed! 


  ===== Suite Data =====

    | Test Bool Ord ... Passed! 
    | Test Bool Hash ... Passed! 
    | Test Bool Asctypes ... Passed! 
    | Test Char Create ... Passed! 
    | Test Char Ord ... Passed! 
    | Test Char Hash ... Passed! 
    | Test Int Create ... Passed! 
    | Test Int Ord ... Passed! 
    | Test Int Hash ... Passed! 
    | Test Int Num ... Passed! 
    | Test Int Parse ... Passed! 
    | Test Real Create ... Passed! 
    | Test Real Ord ... Passed! 
    | Test Real Hash ... Passed! 
    | Test Real Num ... Passed! 
    | Test Real Parse ... Passed! 
    | Test String Create ... Passed! 
    | Test String Ord ... Passed! 
    | Test String Collection ... Passed! 
    | Test String Hash ... Passed! 
    | Test String Reverse ... Passed! 
    | Test Array Create ... Passed! 
    | Test Array Eq ... Passed! 
    | Test Array Collection ... Passed! 
    | Test Array Push ... Passed! 
    | Test Array At ... Passed! 
    | Test Array Iter ... Passed! 
    | Test Array Reverse ... Passed! 
    | Test Table Create ... Passed! 
    | Test Table Collection ... Passed! 
    | Test Table Dict ... Passed! 
    | Test Table Iter ... Passed! 
    | Test Tree Create ... Passed! 
    | Test Tree Collection ... Passed! 
    | Test Tree Dict ... Passed! 
    | Test Tree Iter ... Passed! 
    | Test List Create ... Passed! 
    | Test List Eq ... Passed! 
    | Test List Collection ... Passed! 
    | Test List Push ... Passed! 
    | Test List At ... Passed! 
    | Test List Iter ... Passed! 
    | Test List Reverse ... Passed! 
    | Test Dictionary Create ... Passed! 
    | Test Dictionary Collection ... Passed! 
    | Test Dictionary Iter ... Passed! 
    | Test Dictionary Dict ... Passed! 
    | Test Map Create ... Passed! 
    | Test Map Collection ... Passed! 
    | Test Map Iter ... Passed! 
    | Test Map Dict ... Passed! 
    | Test File Create ... Passed! 
    | Test File Read ... Passed! 
    | Test File Dict ... Passed! 


  ===== Suite Exception =====

    | Test Throw ... Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:28)

    | Test Catch ... Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:60)

    | Test Catch All ... Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:83)

    | Test Catch Outer ... Failed! 

        1. Assert [ Exception_Depth() is 1 ] (tests/exceptions.c:94)
        2. Assert [ Exception_Depth() is 2 ] (tests/exceptions.c:97)
        3. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:112)



  ===== Suite Memory =====

    | Test New ... Passed! 
    | Test Reference ... Passed! 
    | Test Reference With ... Passed! 
    | Test Reference With Many ... Passed! 
    | Test Pool ... Passed! 


  ===== Suite Threading =====

    | Test New ... Passed! 
    | Test Multiple ... Passed! 
    | Test Mutex ... Passed! 
    | Test Exception ... Passed! 

  +---------------------------------------------------+
  |                      Summary                      |
  +---------++------------+-------------+-------------+
  | Suites  || Total    6 | Passed    5 | Failed    1 |
  | Tests   || Total  111 | Passed  107 | Failed    4 |
  | Asserts || Total  665 | Passed  659 | Failed    6 |
  +---------++------------+-------------+-------------+

      Total Running Time: 0.071s

Tested against 59f72eb with no other changes, all tests except the Exception suite pass. :)

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Thanks. I wonder if you would be able to run make clean before make check. I have a suspicion that some old object files might be causing trouble.

Otherwise would you be able to add the line printf("\nDepth: %i\n", Exception_Depth()); above all of the failed asserts in the Exception suite. Would be good to see what the actual value is!

from cello.

novabyte avatar novabyte commented on July 18, 2024

Sure, no probs. Running make clean:

$ make clean
rm obj/Array.o obj/Bool.o obj/Char.o obj/Dictionary.o obj/Exception.o obj/File.o obj/Format.o obj/Function.o obj/Lambda.o obj/List.o obj/Map.o obj/Number.o obj/Pool.o obj/Prelude.o obj/Reference.o obj/String.o obj/Table.o obj/Thread.o obj/Tree.o obj/Type.o obj/core.o obj/data.o obj/exceptions.o obj/functional.o obj/memory.o obj/ptest.o obj/test.o obj/threading.o obj/Vec2.o obj/example.o obj/files.o obj/functions.o obj/lists.o obj/reference.o obj/threading.o obj/types.o libCello.a libCello.so
rm: obj/Vec2.o: No such file or directory
rm: obj/example.o: No such file or directory
rm: obj/files.o: No such file or directory
rm: obj/functions.o: No such file or directory
rm: obj/lists.o: No such file or directory
rm: obj/reference.o: No such file or directory
rm: obj/threading.o: No such file or directory
rm: obj/types.o: No such file or directory
rm: libCello.so: No such file or directory
make: *** [clean] Error 1

I've applied the changes like so git diff:

$ git diff
diff --git a/tests/exceptions.c b/tests/exceptions.c
index cb21817..d34cf3e 100644
--- a/tests/exceptions.c
+++ b/tests/exceptions.c
@@ -20,7 +20,9 @@ PT_SUITE(suite_exception) {
     int r0 = exception_divide(2, 1);
     int r1 = exception_divide(4, 2);
     int r2 = exception_divide(9, 3);
-    
+
+    printf("\nDepth: %i\n", Exception_Depth());
+
     PT_ASSERT(r0 == 2);
     PT_ASSERT(r1 == 2);
     PT_ASSERT(r2 == 3);
@@ -52,7 +54,9 @@ PT_SUITE(suite_exception) {
     } catch (e in None) {
       reached2 = true;
     }
-    
+
+    printf("\nDepth: %i\n", Exception_Depth());
+
     PT_ASSERT(reached0);
     PT_ASSERT(not reached1);
     PT_ASSERT(not reached2);
@@ -91,6 +95,8 @@ PT_SUITE(suite_exception) {

     try {

+    printf("\nDepth: %i\n", Exception_Depth());
+
     PT_ASSERT(Exception_Depth() is 1);

       try {
@@ -100,12 +106,16 @@ PT_SUITE(suite_exception) {
         reached0 = true;
       }    

+      printf("\nDepth: %i\n", Exception_Depth());
+
       PT_ASSERT(Exception_Depth() is 1);

     } catch (e) {
       reached1  = true;
     }
-    
+
+    printf("\nDepth: %i\n", Exception_Depth());
+
     PT_ASSERT(not reached0);
     PT_ASSERT(reached1);

The relevant part of the test results are:

  ===== Suite Exception =====

    | Test Throw ... 
Depth: 10
Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:30)

    | Test Catch ... 
Depth: 10
Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:64)

    | Test Catch All ... Failed! 

        1. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:87)

    | Test Catch Outer ... 
Depth: 11

Depth: 10
Failed! 

        1. Assert [ Exception_Depth() is 1 ] (tests/exceptions.c:100)
        2. Assert [ Exception_Depth() is 2 ] (tests/exceptions.c:103)
        3. Assert [ Exception_Depth() is 0 ] (tests/exceptions.c:122)

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Very Weird. No idea why it might be set to 10. It at least seems functionally correct so it could be some crazy optimization the compiler is performing. I think that's all the testing that is going to work until I can look into it deeper. Many Thanks for all the help.

from cello.

novabyte avatar novabyte commented on July 18, 2024

@orangeduck I thought that was very weird too. I'm glad I could help. This project is a great piece of work.

Huge 👍

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Managed to sneakily borrow my friends mac and check out the issue. Should be fixed now in 7c9586b but would be good if someone could verify.

If it is fixed I think I might update the version to 1.0 and update the link on the website etc.

from cello.

novabyte avatar novabyte commented on July 18, 2024

I pulled the latest changes (at 813ff7a), everything's good to go 👍

$ make check
gcc tests/core.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/core.o
gcc tests/data.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/data.o
gcc tests/exceptions.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/exceptions.o
gcc tests/functional.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/functional.o
gcc tests/memory.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/memory.o
gcc tests/ptest.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/ptest.o
gcc tests/test.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/test.o
gcc tests/threading.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -fblocks -fnested-functions -o obj/threading.o
gcc obj/core.o obj/data.o obj/exceptions.o obj/functional.o obj/memory.o obj/ptest.o obj/test.o obj/threading.o libCello.a -lpthread -lm -o test
./test

    +-------------------------------------------+
    | ptest          MicroTesting Magic for C   |
    |                                           |
    | Daniel Holden ([email protected]) |
    +-------------------------------------------+


  ===== Suite Core =====

    | Test Type ... Passed! 
    | Test Cast ... Passed! 
    | Test New ... Passed! 
    | Test Assign ... Passed! 
    | Test Copy ... Passed! 
    | Test Eq ... Passed! 
    | Test Ord ... Passed! 
    | Test Hash ... Passed! 
    | Test Collection ... Passed! 
    | Test Iter ... Passed! 
    | Test Push ... Passed! 
    | Test At ... Passed! 
    | Test Dict ... Passed! 
    | Test As Ctype ... Passed! 
    | Test Stream ... Passed! 
    | Test Type New ... Passed! 
    | Test Type Implements ... Passed! 
    | Test Show ... Passed! 
    | Test Look ... Passed! 


  ===== Suite Functional =====

    | Test Stack Function ... Passed! 
    | Test Heap Function ... Passed! 
    | Test Function Assign ... Passed! 
    | Test Function Copy ... Passed! 
    | Test Call ... Passed! 
    | Test Call With ... Passed! 
    | Test Call With Ptr ... Passed! 
    | Test Lambda ... Passed! 
    | Test Lambda Id ... Passed! 
    | Test Lambda Const ... Passed! 
    | Test Lambda Compose ... Passed! 
    | Test Lambda Flip ... Passed! 
    | Test Lambda Pipe ... Passed! 
    | Test Lambda Method Pipe ... Passed! 
    | Test Lambda Partial L ... Passed! 
    | Test Lambda Partial R ... Passed! 
    | Test Lambda Uncurry ... Passed! 
    | Test Lambda Void Uncurry ... Passed! 
    | Test Map ... Passed! 
    | Test New Map ... Passed! 
    | Test New Filter ... Passed! 
    | Test New Sum ... Passed! 
    | Test New Product ... Passed! 
    | Test New Foldl ... Passed! 
    | Test New Foldr ... Passed! 


  ===== Suite Data =====

    | Test Bool Ord ... Passed! 
    | Test Bool Hash ... Passed! 
    | Test Bool Asctypes ... Passed! 
    | Test Char Create ... Passed! 
    | Test Char Ord ... Passed! 
    | Test Char Hash ... Passed! 
    | Test Int Create ... Passed! 
    | Test Int Ord ... Passed! 
    | Test Int Hash ... Passed! 
    | Test Int Num ... Passed! 
    | Test Int Parse ... Passed! 
    | Test Real Create ... Passed! 
    | Test Real Ord ... Passed! 
    | Test Real Hash ... Passed! 
    | Test Real Num ... Passed! 
    | Test Real Parse ... Passed! 
    | Test String Create ... Passed! 
    | Test String Ord ... Passed! 
    | Test String Collection ... Passed! 
    | Test String Hash ... Passed! 
    | Test String Reverse ... Passed! 
    | Test Array Create ... Passed! 
    | Test Array Eq ... Passed! 
    | Test Array Collection ... Passed! 
    | Test Array Push ... Passed! 
    | Test Array At ... Passed! 
    | Test Array Iter ... Passed! 
    | Test Array Reverse ... Passed! 
    | Test Table Create ... Passed! 
    | Test Table Collection ... Passed! 
    | Test Table Dict ... Passed! 
    | Test Table Iter ... Passed! 
    | Test Tree Create ... Passed! 
    | Test Tree Collection ... Passed! 
    | Test Tree Dict ... Passed! 
    | Test Tree Iter ... Passed! 
    | Test List Create ... Passed! 
    | Test List Eq ... Passed! 
    | Test List Collection ... Passed! 
    | Test List Push ... Passed! 
    | Test List At ... Passed! 
    | Test List Iter ... Passed! 
    | Test List Reverse ... Passed! 
    | Test Dictionary Create ... Passed! 
    | Test Dictionary Collection ... Passed! 
    | Test Dictionary Iter ... Passed! 
    | Test Dictionary Dict ... Passed! 
    | Test Map Create ... Passed! 
    | Test Map Collection ... Passed! 
    | Test Map Iter ... Passed! 
    | Test Map Dict ... Passed! 
    | Test File Create ... Passed! 
    | Test File Read ... Passed! 
    | Test File Dict ... Passed! 


  ===== Suite Exception =====

    | Test Throw ... Passed! 
    | Test Catch ... Passed! 
    | Test Catch All ... Passed! 
    | Test Catch Outer ... Passed! 


  ===== Suite Memory =====

    | Test New ... Passed! 
    | Test Reference ... Passed! 
    | Test Reference With ... Passed! 
    | Test Reference With Many ... Passed! 
    | Test Pool ... Passed! 


  ===== Suite Threading =====

    | Test New ... Passed! 
    | Test Multiple ... Passed! 
    | Test Mutex ... Passed! 
    | Test Exception ... Passed! 

  +---------------------------------------------------+
  |                      Summary                      |
  +---------++------------+-------------+-------------+
  | Suites  || Total    6 | Passed    6 | Failed    0 |
  | Tests   || Total  111 | Passed  111 | Failed    0 |
  | Asserts || Total  665 | Passed  665 | Failed    0 |
  +---------++------------+-------------+-------------+

      Total Running Time: 0.078s

from cello.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.