Skip to content

Fix = vs == typos in test assertions. NFC #24194

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

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions test/browser/test_sdl_set_clip_rect.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ int main() {
SDL_SetClipRect(dst, &firstRect);
SDL_BlitSurface(src, &rect, dst, &rect);

assert(rect.x = firstRect.x);
assert(rect.y = firstRect.y);
assert(rect.w = firstRect.w);
assert(rect.h = firstRect.h);
assert(rect.x == firstRect.x);
assert(rect.y == firstRect.y);
assert(rect.w == firstRect.w);
assert(rect.h == firstRect.h);

/* Draw green rect on red rect */
SDL_FillRect(src, &rect, SDL_MapRGB(src->format, 0, 255, 0));
SDL_SetClipRect(dst, &secondRect);
SDL_BlitSurface(src, &rect, dst, &rect);

assert(rect.x = secondRect.x);
assert(rect.y = secondRect.y);
assert(rect.w = firstRect.x + firstRect.w);
assert(rect.h = firstRect.h + firstRect.h);
assert(rect.x == secondRect.x);
assert(rect.y == secondRect.y);
// FIXME(https://github.com/emscripten-core/emscripten/issues/24201)
//assert(rect.w == firstRect.x + firstRect.w);
//assert(rect.h == firstRect.h + firstRect.h);

/* Same with fill rect */
rect.x = 0; rect.y = 0;
Expand All @@ -64,18 +65,19 @@ int main() {
SDL_SetClipRect(dst, &firstRectForFill);
SDL_FillRect(dst, &rect, SDL_MapRGB(dst->format, 0, 0, 255));

assert(rect.x = firstRectForFill.x);
assert(rect.y = firstRectForFill.y);
assert(rect.w = firstRectForFill.w);
assert(rect.h = firstRectForFill.h);
assert(rect.x == firstRectForFill.x);
assert(rect.y == firstRectForFill.y);
assert(rect.w == firstRectForFill.w);
assert(rect.h == firstRectForFill.h);

SDL_SetClipRect(dst, &secondRectForFill);
SDL_FillRect(dst, &rect, SDL_MapRGBA(dst->format, 255, 0, 255, 255));

assert(rect.x = secondRectForFill.x);
assert(rect.y = secondRectForFill.y);
assert(rect.w = firstRectForFill.x + firstRectForFill.w);
assert(rect.h = firstRectForFill.h + firstRectForFill.h);
assert(rect.x == secondRectForFill.x);
assert(rect.y == secondRectForFill.y);
// FIXME(https://github.com/emscripten-core/emscripten/issues/24201)
//assert(rect.w == firstRectForFill.x + firstRectForFill.w);
//assert(rect.h == firstRectForFill.h + firstRectForFill.h);

SDL_GetClipRect(dst, &rectForTest);
assert(rectForTest.x == 270);
Expand Down
2 changes: 1 addition & 1 deletion test/core/test_dlfcn_self.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void repeatable() {

int* global_ptr = (int*)dlsym(self, "global");
assert(global_ptr);
assert(*global_ptr = 123);
assert(*global_ptr == 123);

void (*foo_ptr)(int) = (void (*)(int))dlsym(self, "foo");
assert(foo_ptr);
Expand Down
4 changes: 2 additions & 2 deletions test/other/test_stat_fail_alongtheway.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main() {
{
struct stat st;
assert(stat("path", &st) == 0);
assert(st.st_mode = 0777);
assert((st.st_mode & ~S_IFMT) == 0777);
}
{
struct stat st;
Expand All @@ -25,7 +25,7 @@ int main() {
{
struct stat st;
assert(stat("path/file", &st) == 0);
assert(st.st_mode = 0666);
assert((st.st_mode & ~S_IFMT) == 0644);
}
{
struct stat st;
Expand Down
4 changes: 2 additions & 2 deletions test/unistd/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ void setup() {
FILE* f = fopen("towrite", "w");
assert(f);
rtn = fwrite("abcdef", 6, 1, f);
assert(rtn = 6);
assert(rtn == 1);
fclose(f);

f = fopen("toread", "w");
assert(f);
rtn = fwrite("abcdef", 6, 1, f);
assert(rtn = 6);
assert(rtn == 1);
fclose(f);

assert(chmod("toread", 0444) == 0);
Expand Down
2 changes: 1 addition & 1 deletion test/webaudio/audioworklet_params_mixing.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool process(int numInputs, const AudioSampleFrame* inputs, int numOutputs, Audi
// Interestingly, params varies per browser. Chrome won't have a length > 1
// unless the value changes, and FF has all 128 entries even for a k-rate
// parameter. The only given is that two params are incoming:
assert(numParams = 2);
assert(numParams == 2);
assert(params[0].length == 1 || params[0].length == outSamplesPerChannel);
assert(params[1].length == 1 || params[1].length == outSamplesPerChannel);
// We can now do a quick mix since we know the layouts
Expand Down