Skip to content

Commit dad59e5

Browse files
committed
Fix = vs == typos in test assertions. NFC
I first noticed a type in audioworklet_params_mixing.c from emscripten-core#23659 then found several other tests with the same issue. Nasty. Not sure what to do about the test_sdl_set_clip_rect assertions which don't seem to be valid (i.e. they fail with the typo fixed).
1 parent 76860cc commit dad59e5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

test/core/test_dlfcn_self.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void repeatable() {
2222

2323
int* global_ptr = (int*)dlsym(self, "global");
2424
assert(global_ptr);
25-
assert(*global_ptr = 123);
25+
assert(*global_ptr == 123);
2626

2727
void (*foo_ptr)(int) = (void (*)(int))dlsym(self, "foo");
2828
assert(foo_ptr);

test/other/test_stat_fail_alongtheway.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main() {
1414
{
1515
struct stat st;
1616
assert(stat("path", &st) == 0);
17-
assert(st.st_mode = 0777);
17+
assert((st.st_mode & ~S_IFMT) == 0777);
1818
}
1919
{
2020
struct stat st;
@@ -25,7 +25,7 @@ int main() {
2525
{
2626
struct stat st;
2727
assert(stat("path/file", &st) == 0);
28-
assert(st.st_mode = 0666);
28+
assert((st.st_mode & ~S_IFMT) == 0644);
2929
}
3030
{
3131
struct stat st;

test/unistd/truncate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ void setup() {
1919
FILE* f = fopen("towrite", "w");
2020
assert(f);
2121
rtn = fwrite("abcdef", 6, 1, f);
22-
assert(rtn = 6);
22+
assert(rtn == 1);
2323
fclose(f);
2424

2525
f = fopen("toread", "w");
2626
assert(f);
2727
rtn = fwrite("abcdef", 6, 1, f);
28-
assert(rtn = 6);
28+
assert(rtn == 1);
2929
fclose(f);
3030

3131
assert(chmod("toread", 0444) == 0);

test/webaudio/audioworklet_params_mixing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool process(int numInputs, const AudioSampleFrame* inputs, int numOutputs, Audi
3333
// Interestingly, params varies per browser. Chrome won't have a length > 1
3434
// unless the value changes, and FF has all 128 entries even for a k-rate
3535
// parameter. The only given is that two params are incoming:
36-
assert(numParams = 2);
36+
assert(numParams == 2);
3737
assert(params[0].length == 1 || params[0].length == outSamplesPerChannel);
3838
assert(params[1].length == 1 || params[1].length == outSamplesPerChannel);
3939
// We can now do a quick mix since we know the layouts

0 commit comments

Comments
 (0)