This commit is contained in:
Josh Soref 2025-02-25 12:32:29 -08:00 committed by GitHub
commit 74b93756f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
516 changed files with 1078 additions and 1078 deletions

View file

@ -114,7 +114,7 @@ static unsigned long s_le_create_connection_callback_param;
int GAP_LE_Create_Connection(unsigned int BluetoothStackID,
unsigned int ScanInterval,
unsigned int ScanWindow,
GAP_LE_Filter_Policy_t InitatorFilterPolicy,
GAP_LE_Filter_Policy_t InitiatorFilterPolicy,
GAP_LE_Address_Type_t RemoteAddressType,
BD_ADDR_t *RemoteDevice,
GAP_LE_Address_Type_t LocalAddressType,
@ -207,7 +207,7 @@ int GAP_LE_Cancel_Create_Connection(unsigned int BluetoothStackID) {
return 0;
}
// Puts the event that the BT Controller will emit after a succesfull
// Puts the event that the BT Controller will emit after a successful
// GAP_LE_Cancel_Create_Connection call.
void fake_gap_le_put_cancel_create_event(const BTDeviceInternal *device, bool is_master) {
fake_gap_put_connection_event(HCI_ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER,

View file

@ -46,7 +46,7 @@ AlgDlsMinuteData *activity_sample_2015_09_30_23_04_00(int *len) {
//> TEST_IN_DEEP_SLEEP_MAX 0
//> TEST_WEIGHT 1.0
// list of: {steps, orientation, vmc, ligh}
// list of: {steps, orientation, vmc, light}
static AlgDlsMinuteData samples[] = {
{ 11, 0x56, 990, 0x0},
{ 0, 0x47, 261, 0x0},

View file

@ -46,7 +46,7 @@ AlgDlsMinuteData *activity_sample_2015_10_08_18_58_01(int *len) {
//> TEST_IN_DEEP_SLEEP_MAX 0
//> TEST_WEIGHT 1.0
// list of: {steps, orientation, vmc, ligh}
// list of: {steps, orientation, vmc, light}
static AlgDlsMinuteData samples[] = {
{ 0, 0x55, 148, 0x0},
{ 8, 0x55, 374, 0x0},

View file

@ -46,7 +46,7 @@ AlgDlsMinuteData *activity_sample_2015_10_08_12_35_00(int *len) {
//> TEST_IN_DEEP_SLEEP_MAX 0
//> TEST_WEIGHT 1.0
// list of: {steps, orientation, vmc, ligh}
// list of: {steps, orientation, vmc, light}
static AlgDlsMinuteData samples[] = {
{ 0, 0x0, 0, 0x2},
{ 9, 0x7d, 1496, 0x0},

View file

@ -43,7 +43,7 @@ AlgDlsMinuteData *activity_sample_2015_10_07_14_39_00(int *len) {
//> TEST_IN_DEEP_SLEEP_MAX 0
//> TEST_WEIGHT 1.0
// list of: {steps, orientation, vmc, ligh}
// list of: {steps, orientation, vmc, light}
static AlgDlsMinuteData samples[] = {
{ 0, 0x72, 1836, 0x0},
{ 71, 0x5f, 4438, 0x0},

View file

@ -2671,7 +2671,7 @@ AlgDlsMinuteData *activity_sample_sleep_v1_3(int *len) {
// ----------------------------------------------------------------
// Sample captured at: 2015-08-22 19:57:00 local, 2015-08-23 02:57:00 GMT
// Accroding to misfit:
// According to misfit:
// total sleep: 374 min
// deep: 200 min
// light: 174 min

View file

@ -17,7 +17,7 @@
// DESCRIPTION:
// This test stops towards the end of a regular sleep session.
// - Test that we have an orarching Sleep session that starts around 75-90 and lasts
// - Test that we have an overarching Sleep session that starts around 75-90 and lasts
// until we shut activity down
// - Test that we have 3 full deep sleep sessions.
// ----------------------------------------------------------------
@ -897,7 +897,7 @@
// DESCRIPTION:
// This test stops towards the end of a deep sleep session.
// - Test that we have an orarching Sleep session that starts around 75-90 and lasts
// - Test that we have an overarching Sleep session that starts around 75-90 and lasts
// until we shut activity down
// - Test that we have 2 full deep sleep sessions, and cut off the one in progress at
// 18-19 minutes into it. It should not be saved. We judge this based on total time
@ -1779,8 +1779,8 @@
// DESCRIPTION:
// This test stops in the middle of a deep sleep session.
// - Test that we have an orarching Sleep session that starts around 75-90 and lasts
// until we shuwn activity down
// - Test that we have an overarching Sleep session that starts around 75-90 and lasts
// until we shut activity down
// - Test that we have 2 full deep sleep sessions, and cut off the one in progress at
// ~22 minutes into it. It should be saved. We judge this based on total time
// in deep sleep

View file

@ -91,7 +91,7 @@ void test_ble_ad_parse__16_bit_uuid_and_device_name(void) {
Uuid missing_uuid = bt_uuid_expand_16bit(0xabcd);
cl_assert(!ble_ad_includes_service(s_ad_data, &missing_uuid));
// Test ble_ad_copy_service_uuids, destination array sized larged enough:
// Test ble_ad_copy_service_uuids, destination array sized large enough:
const uint8_t count = 4;
Uuid copied_uuids[count];
uint8_t found = ble_ad_copy_service_uuids(s_ad_data, copied_uuids, count);

View file

@ -183,7 +183,7 @@ void test_app_smartstrap__invalid_args(void) {
}
void test_app_smartstrap__check_ids(void) {
// craete an attribute
// create an attribute
SmartstrapAttribute *attr = app_smartstrap_attribute_create(0x1111, 0x2222, 100);
cl_assert(attr != NULL);

View file

@ -175,8 +175,8 @@ void test_workout_active__cleanup(void) {
//////////////////////
static void prv_create_window_and_render(WorkoutActiveWindow *active_window,
int seconday_metric_idx) {
for (int i = 0; i < seconday_metric_idx; i++) {
int secondary_metric_idx) {
for (int i = 0; i < secondary_metric_idx; i++) {
prv_cycle_scrollable_metrics(active_window);
}

View file

@ -80,7 +80,7 @@ void launcher_task_add_callback(void (*callback)(void *data), void *data) {
s_launcher_task_callback_data = data;
}
// Tests: Disover AMS
// Tests: Discover AMS
///////////////////////////////////////////////////////////
#define NUM_AMS_INSTANCES 2
static BLECharacteristic s_characteristics[NUM_AMS_INSTANCES][NumAMSCharacteristic] = {
@ -133,10 +133,10 @@ void test_ams__discover_of_ams_should_subscribe_to_entity_update_characteristic(
// Pass in 2 instances, it should be able to cope with this
prv_discover_ams(2 /* num_instances */);
// Assert ams.c can now handle the characteristic reference for the first instance:
// Assert ams.c can handle the characteristic reference for the first instance:
prv_assert_can_handle_characteristics(0, true /* expect_can_handle */);
// Assert ams.c can not handle the characteristic reference for the second instance:
// Assert ams.c cannot handle the characteristic reference for the second instance:
prv_assert_can_handle_characteristics(1, false /* expect_can_handle */);
// The first instance is expected to be used.

View file

@ -254,7 +254,7 @@ void test_ams_util__csv_buffer_not_zero_terminated(void) {
const char one_value[] = "ABCDEF";
cl_assert(sizeof(one_value) > 2);
const uint8_t count = ams_util_csv_parse(one_value,
sizeof(one_value) - 1 /* omit zero teminator */, NULL,
sizeof(one_value) - 1 /* omit zero terminator */, NULL,
prv_result_callback);
cl_assert_equal_i(s_results_count, 1);
cl_assert_equal_i(count, 1);

View file

@ -187,7 +187,7 @@ BTErrno gatt_client_op_write(BLECharacteristic characteristic,
return BTErrnoInvalidParameter;
}
const uint32_t comple_dict_uid = ((GetNotificationAttributesMsg*)s_complete_dict)->notification_uid;
const uint32_t complete_dict_uid = ((GetNotificationAttributesMsg*)s_complete_dict)->notification_uid;
const uint32_t chunked_dict_uid = ((GetNotificationAttributesMsg*)s_chunked_dict_part_one)->notification_uid;
const uint32_t message_size_attr_dict_uid = ((GetNotificationAttributesMsg*)s_message_size_attr_dict)->notification_uid;
const uint32_t invalid_dict_uid = ((GetNotificationAttributesMsg*)s_invalid_attribute_length)->notification_uid;
@ -221,7 +221,7 @@ BTErrno gatt_client_op_write(BLECharacteristic characteristic,
uint32_t uid = ((GetNotificationAttributesMsg *)buffer)->notification_uid;
s_num_requested_notif_attributes++;
if (uid == comple_dict_uid) {
if (uid == complete_dict_uid) {
prv_fake_receiving_ds_notification(ARRAY_LENGTH(s_complete_dict), (uint8_t*) s_complete_dict);
s_num_ds_notifications_received++;
} else if (uid == chunked_dict_uid) {
@ -353,7 +353,7 @@ void test_ancs__should_handle_small_and_large_messages(void) {
cl_assert_equal_i(fake_kernel_services_notifications_ancs_notifications_count(), 4 + 4 + 4);
}
void test_ancs__should_handle_message_size_attribtue(void) {
void test_ancs__should_handle_message_size_attribute(void) {
prv_send_notification((uint8_t *)&s_message_size_attr_dict);
cl_assert_equal_i(s_num_requested_notif_attributes, 1);
cl_assert_equal_i(s_num_ds_notifications_received, 1);
@ -437,7 +437,7 @@ void test_ancs__ancs_invalid_param(void) {
.uid = 0,
};
const uint32_t comple_dict_uid = ((GetNotificationAttributesMsg*)s_complete_dict)->notification_uid;
const uint32_t complete_dict_uid = ((GetNotificationAttributesMsg*)s_complete_dict)->notification_uid;
ns_notification.uid = s_invalid_param_uid;
// This will return with an error ANCS_INVALID_PARAM
@ -446,7 +446,7 @@ void test_ancs__ancs_invalid_param(void) {
cl_assert_equal_i(s_num_requested_notif_attributes, 1 );
cl_assert_equal_i(s_num_ds_notifications_received, 1);
ns_notification.uid = comple_dict_uid;
ns_notification.uid = complete_dict_uid;
prv_fake_receiving_ns_notification(sizeof(ns_notification), (uint8_t*) &ns_notification);
cl_assert_equal_i(s_num_requested_notif_attributes, 2);
cl_assert_equal_i(s_num_ds_notifications_received, 2);
@ -465,7 +465,7 @@ void test_ancs__ancs_invalid_param(void) {
cl_assert_equal_i(s_num_requested_notif_attributes, 4);
cl_assert_equal_i(s_num_ds_notifications_received, 4);
ns_notification.uid = comple_dict_uid;
ns_notification.uid = complete_dict_uid;
prv_fake_receiving_ns_notification(sizeof(ns_notification), (uint8_t*) &ns_notification);
cl_assert_equal_i(s_num_requested_notif_attributes, 5);
cl_assert_equal_i(s_num_ds_notifications_received, 5);

View file

@ -95,8 +95,8 @@ void test_gap_le_advert__initialize(void) {
s_unscheduled_job = NULL;
s_unscheduled_completed = false;
// This bypasses the work-around for the CC2564 advertising bug, that pauses the round-robinning
// through scheduled advertisment jobs:
// This bypasses the workaround for the CC2564 advertising bug, that pauses the round-robining
// through scheduled advertisement jobs:
s_is_connected_as_slave = true;
regular_timer_init();
@ -827,7 +827,7 @@ void test_gap_le_advert__invalid_params(void) {
}
void test_gap_le_advert__unschedule_non_existent(void) {
// Unscheduling non-existent job should be fine, should not crash:
// Unscheduling nonexistent job should be fine, should not crash:
gap_le_advert_unschedule((GAPLEAdvertisingJobRef)(uintptr_t) 0x1234);
// Unschedule callback should not have been called:

View file

@ -678,7 +678,7 @@ void test_gap_le_connect__slave_disconnection_event_upon_cancel_connect_by_bondi
// -------------------------------------------------------------------------------------------------
// Pairing
void __disabled_test_gap_le_connect__one_shot_intent_removed_when_disconnected_before_encrpt(void) {
void __disabled_test_gap_le_connect__one_shot_intent_removed_when_disconnected_before_encrypt(void) {
BTDeviceInternal device = prv_dummy_device(1);
// Register connection one-shot intent, with pairing required:

View file

@ -222,7 +222,7 @@ void test_gatt_service_changed_client__handle_indication_service_changed(void) {
fake_gatt_is_service_discovery_start_count());
}
void test_gatt_service_changed_client__handle_indication_service_changed_malformatted(void) {
void test_gatt_service_changed_client__handle_indication_service_changed_malformed(void) {
fake_gatt_put_discovery_indication_gatt_profile_service(TEST_GATT_CONNECTION_ID,
true /* has_service_changed_characteristic */);
const uint16_t att_handle = fake_gatt_gatt_profile_service_service_changed_att_handle();

View file

@ -1101,6 +1101,6 @@ void test_ppogatt__mtu_zero_due_to_service_rediscovery_while_resetting(void) {
// No crash nor DUMA failures
}
void test_ppogatt__unsubcribe_when_no_memory_for_comm_session(void) {
void test_ppogatt__unsubscribe_when_no_memory_for_comm_session(void) {
// TODO
}

View file

@ -236,7 +236,7 @@ void test_flash_erase__96k_app_banks_1(void) {
}
void test_flash_erase__96k_app_banks_2(void) {
// App that's in an aligned bank but larger than than 64k
// App that's in an aligned bank but larger than 64k
prv_test_erase_optimal_range(
0, 0, 69 * 1024, 96 * 1024,
(EraseCommand[]) {
@ -262,7 +262,7 @@ void test_flash_erase__96k_app_banks_3(void) {
}
void test_flash_erase__96k_app_banks_4(void) {
// App that's in an unaligned bank but larger than than 64k
// App that's in an unaligned bank but larger than 64k
prv_test_erase_optimal_range(
32 * 1024, 32 * 1024, (32 + 71) * 1024, (32 + 96) * 1024,
(EraseCommand[]) {

View file

@ -251,7 +251,7 @@ void test_bitblt__8bit_comptint_blend(void) {
(GColor8){.a = 3, .r = 2, .g = 1, .b = 0}
};
// Test image with four pixels of all our suported alpha values
// Test image with four pixels of all our supported alpha values
GBitmap test_bmp = (GBitmap){
.addr = test_blend_colors,
.row_size_bytes = 4,
@ -319,7 +319,7 @@ void test_bitblt__8bit_clipping(void) {
// Test horizontal wrapping when dest_rect wider than src_bitmap.
// Setup:
// - Source 15 x 10, each row has the folling pattern:
// - Source 15 x 10, each row has the following pattern:
// - 2px Red
// - 13px Black
// - Dest Green 50x50

View file

@ -143,7 +143,7 @@ void test_bitblt_palette_1bit__2bit_palette_to_1bit_set(void) {
// The left half is semi-transparent and the right half is completely opaque
// - Dest is 50x50, white.
// Result:
// - The image desribed will be tiled in each of the four corners
// - The image described will be tiled in each of the four corners
// The top right half will be alternating between dithered gray and black lines
// The bottom right half consists of a diagonal white line on a black background
// The left half will be completely white
@ -169,13 +169,13 @@ void test_bitblt_palette_1bit__2bit_palette_to_1bit_wrap(void) {
// The top right half will be alternating between dithered gray and black lines
// The bottom right half consists of a diagonal white line on a black background
// The left half will be completely white
void test_bitblt_palette_1bit__2bit_palette_to_1bit_offest(void) {
void test_bitblt_palette_1bit__2bit_palette_to_1bit_offset(void) {
GBitmap *src_bitmap =
get_gbitmap_from_pbi("test_bitblt_palette_1bit__2bit_palette_to_1bit.pbi");
bitblt_bitmap_into_bitmap(&s_dest_bitmap, src_bitmap, GPoint(20,20), GCompOpAssign, GColorWhite);
cl_assert(gbitmap_pbi_eq(&s_dest_bitmap,
"test_bitblt_palette_1bit__2bit_palette_to_1bit_offest-expect.pbi"));
"test_bitblt_palette_1bit__2bit_palette_to_1bit_offset-expect.pbi"));
gbitmap_destroy(src_bitmap);
}

View file

@ -88,7 +88,7 @@ static const char *prv_get_image_name(const char* func_name, int index, const ch
// Result:
// - gbitmaps matches platform decoded APNG
void test_gbitmap_sequence__color_2bit_bouncing_ball(void) {
#if PLATFROM_SPALDING
#if PLATFORM_SPALDING
uint32_t resource_id = sys_resource_load_file_as_resource(TEST_IMAGES_PATH, GET_APNG_NAME);
cl_assert(resource_id != UINT32_MAX);

View file

@ -93,7 +93,7 @@ void test_graphics_colors__equal__deprecated(void) {
void test_graphics_colors__inverted_readable_color(void) {
GColor8 (*fun)(GColor8) = gcolor_legible_over;
// transparent colors result in transparen - who has a better idea?
// transparent colors result in transparent - who has a better idea?
cl_assert_equal_i(GColorClearARGB8, fun(GColorClear).argb);
// // obvious cases

View file

@ -831,7 +831,7 @@ void test_graphics_context_${BIT_DEPTH_NAME}__lock_framebuffer_fails_from_8BitCi
};
void test_graphics_context_${BIT_DEPTH_NAME}__lock_framebuffer_1Bit_on_8BitCircular_must_fail(void) {
// Test for locking of 1Bit framebuffer when frambuffer is 8Bit Circular
// Test for locking of 1Bit framebuffer when framebuffer is 8Bit Circular
GContext ctx = {.dest_bitmap.info.format = GBitmapFormat8BitCircular};
GBitmap *bmp = graphics_capture_frame_buffer_format(&ctx, GBitmapFormat1Bit);
cl_assert(ctx.lock == false);

View file

@ -426,7 +426,7 @@ void test_graphics_draw_text_flow__no_infinite_loop(void) {
.perimeter.impl = &(GPerimeter){.callback = perimeter_for_display_rect},
},
};
char text[] = "Prevent orhpans for tall-enough pages.";
char text[] = "Prevent orphans for tall-enough pages.";
const int16_t line_height = 22;
// some more pixels to show that orphan prevention really only applies if there's enough space
// for enough *full* lines
@ -471,7 +471,7 @@ void test_graphics_draw_text_flow__no_infinite_loop2(void) {
}
},
};
char text[] = "Late again? Can you be on time ever? Seriosly? Dude!!!";
char text[] = "Late again? Can you be on time ever? Seriously? Dude!!!";
prv_prepare_fb_steps_xy(GSize(180, 360), 1, 1);
ctx.draw_state.avoid_text_orphans = true;

View file

@ -543,7 +543,7 @@ void test_graphics_fill_circle_${BIT_DEPTH_NAME}__radial(void){
#endif
uint16_t outer_radius = 30;
int32_t twelveth_of_angle = TRIG_MAX_ANGLE / 12;
int32_t twelfth_of_angle = TRIG_MAX_ANGLE / 12;
int32_t quarter_of_angle = TRIG_MAX_ANGLE / 4;
GPoint center = GPoint(72, 84);
@ -564,9 +564,9 @@ void test_graphics_fill_circle_${BIT_DEPTH_NAME}__radial(void){
graphics_fill_radial_internal(&ctx, pt, test_radiuses[i].radius, outer_radius,
test_quadrants[j].angle_start + offset_angle -
twelveth_of_angle,
twelfth_of_angle,
test_quadrants[j].angle_end + offset_angle +
twelveth_of_angle);
twelfth_of_angle);
offset_angle += quarter_of_angle;
}
@ -605,7 +605,7 @@ void test_graphics_fill_circle_${BIT_DEPTH_NAME}__radial_precise(void){
// Drawing
setup_test_aa_sw(&ctx, fb, ORIGIN_RECT_NO_CLIP, ORIGIN_RECT_NO_CLIP, true, 1);
graphics_fill_radial_precise_internal(&ctx, center, radius_inner, radius_outer, angle_start, angle_end);
cl_check(gbitmap_pbi_eq(&ctx.dest_bitmap, "fill_radial_origin_aa_precise_halfs_letter_c.${BIT_DEPTH_NAME}.pbi"));
cl_check(gbitmap_pbi_eq(&ctx.dest_bitmap, "fill_radial_origin_aa_precise_halves_letter_c.${BIT_DEPTH_NAME}.pbi"));
}
typedef struct {
@ -719,7 +719,7 @@ void prv_draw_radial_in_rect_debugged(GContext *ctx, int16_t width, int16_t heig
int32_t angle_start, int32_t angle_end){
int offset_angle = 0;
int32_t twelveth_of_angle = TRIG_MAX_ANGLE / 12;
int32_t twelfth_of_angle = TRIG_MAX_ANGLE / 12;
GPoint center = GPoint(72, 84);
for (int i=0; i<4; i++) {
@ -739,8 +739,8 @@ void prv_draw_radial_in_rect_debugged(GContext *ctx, int16_t width, int16_t heig
graphics_context_set_stroke_color(ctx, GColorBlack);
graphics_fill_radial(ctx, rect, scale_mode, inset,
angle_start + offset_angle - twelveth_of_angle,
angle_end + offset_angle + twelveth_of_angle);
angle_start + offset_angle - twelfth_of_angle,
angle_end + offset_angle + twelfth_of_angle);
offset_angle += TRIG_MAX_ANGLE / 4;
}

View file

@ -448,7 +448,7 @@ void test_graphics_gpath_8bit__clipping_aa(void) {
// NOTE: Expected result of this test is to have an antialiased stripe go through the screen,
// where antialiased edges are being nicely cut off on top and bottom of the stripe
// (antialiased gradient would dive into the stripe near screen edges), also top
// left corner is intentinally ending just before screen cuts it out to verify that
// left corner is intentionally ending just before screen cuts it out to verify that
// fractional anti-aliasing is not bleeding into row before (would occur as pixels on
// right side of the screen)
cl_check(gbitmap_pbi_eq(&ctx.dest_bitmap,

View file

@ -98,7 +98,7 @@ static char get_terminal_color(uint8_t c) {
}
}
// A simple functon for printing 8-bit gbitmaps to the console.
// A simple function for printing 8-bit gbitmaps to the console.
// Makes it easy to quickly review failing test cases.
void print_bitmap(const GBitmap *bmp) {
printf("Row Size Bytes: %d\n", bmp->row_size_bytes);
@ -238,7 +238,7 @@ static void prv_write_diff_to_file(const char *filename, GBitmap *expected_bmp,
strncpy(ext, EXPECTED_PBI_FILE_EXTENSION, strlen(EXPECTED_PBI_FILE_EXTENSION) + 1);
cl_assert(tests_write_gbitmap_to_pbi(expected_bmp, bmp_filename));
// TODO: PBL-20932 Add 1-bit and palletized support
// TODO: PBL-20932 Add 1-bit and palettized support
if (actual_bmp->info.format == GBitmapFormat8Bit && diff_bmp) {
// Only write the diff file if there is an expected image
strncpy(bmp_filename, filename, PATH_STRING_LENGTH - strlen(DIFF_PBI_FILE_EXTENSION) - 1);
@ -306,7 +306,7 @@ bool gbitmap_eq(GBitmap *actual_bmp, GBitmap *expected_bmp, const char *filename
for (int y = start_y; y < end_y; ++y) {
uint8_t *line = ((uint8_t*)diff_bmp->addr) + (diff_bmp->row_size_bytes * y);
// TODO: PBL-20932 Add 1-bit and palletized support
// TODO: PBL-20932 Add 1-bit and palettized support
if (actual_bmp->info.format == GBitmapFormat8Bit) {
line[(diff_bmp->row_size_bytes / 3) + 1] = GColorClear.argb; // Separator pixel between images
line[(2 * diff_bmp->row_size_bytes / 3) + 1] = GColorClear.argb; // Separator pixel between images
@ -346,7 +346,7 @@ bool gbitmap_eq(GBitmap *actual_bmp, GBitmap *expected_bmp, const char *filename
rc = false;
}
// TODO: PBL-20932 Add 1-bit and palletized support
// TODO: PBL-20932 Add 1-bit and palettized support
if (actual_bmp->info.format == GBitmapFormat8Bit) {
if (actual_bmp_color.argb != expected_bmp_color.argb) {
GColor8 diff_bmp_color = DIFF_COLOR;

View file

@ -166,7 +166,7 @@ void test_rocky_api_global__calls_init_and_notifies_about_apis(void) {
cl_assert(*s_log_internal__expected == NULL);
}
void test_rocky_api_global__can_unsubsribe_event_handlers(void) {
void test_rocky_api_global__can_unsubscribe_event_handlers(void) {
static const RockyGlobalAPI api = {
.add_handler = prv_api_add,
.remove_handler = prv_api_remove,

View file

@ -606,7 +606,7 @@ void test_rocky_api_graphics__fill_text_aligned(void) {
void test_rocky_api_graphics__text_align(void) {
prv_global_init_and_set_ctx();
// intial value
// initial value
cl_assert_equal_i(GTextAlignmentLeft, s_rocky_text_state.alignment);
s_rocky_text_state.alignment = (GTextAlignment)-1;

View file

@ -131,7 +131,7 @@ void test_pulse_logging__simple(void) {
cl_assert_equal_s(s_log_message_buffer, "TestTestTestTestTest");
}
void test_pulse_logging__simple_trucate(void) {
void test_pulse_logging__simple_truncate(void) {
pulse_logging_log(LOG_LEVEL_DEBUG, "", 0, "TestTestTestTestTestTestTestTestTestTest"
"TestTestTestTestTestTestTestTestTestTest"
"TestTestTestTestTestTestTestTestTestTest"
@ -169,7 +169,7 @@ void test_pulse_logging__isr_simple(void) {
cl_assert_equal_s(s_log_message_buffer, "TestTestTestTestTest");
}
void test_pulse_logging__isr_trucate(void) {
void test_pulse_logging__isr_truncate(void) {
s_in_critical_section = true;
pulse_logging_log(LOG_LEVEL_DEBUG, "", 0, "TestTestTestTestTestTestTestTestTestTest"

View file

@ -89,7 +89,7 @@ static const struct tm s_init_time_tm = {
#define ACTIVITY_FIXTURE_PATH "activity"
// The expected resting kcalories is determined empirically from a known good commmit and
// The expected resting kcalories is determined empirically from a known good commit and
// is based on the current time of day and the user's weight, age etc.
const int s_exp_5pm_resting_kcalories = 1031;
const int s_exp_full_day_resting_kcalories = 1455;
@ -496,7 +496,7 @@ bool activity_algorithm_deinit(void) {
}
void activity_algorithm_handle_accel(AccelRawData *data, uint32_t num_samples, uint64_t timestamp) {
// For testing purposes, we'll use the x movment as the steps and y as the sleep state
// For testing purposes, we'll use the x movement as the steps and y as the sleep state
ActivitySleepState prior_state = s_test_alg_state.minute_data.sleep_state;
time_t now_secs = rtc_get_time();
s_test_alg_state.minute_data.last_captured_utc = now_secs;
@ -744,7 +744,7 @@ bool activity_algorithm_test_send_fake_minute_data_dls_record(void) {
// .x : the number of steps to increment by (either 0 or 1)
// .y : the current sleep state
// .z : 0
static void prv_feed_cannned_accel_data(uint32_t num_sec, uint32_t steps_per_minute,
static void prv_feed_canned_accel_data(uint32_t num_sec, uint32_t steps_per_minute,
ActivitySleepState sleep_state) {
uint32_t num_steps = (steps_per_minute * num_sec + 30) / 60;
uint32_t num_samples = num_sec * ALGORITHM_SAMPLING_RATE;
@ -1069,9 +1069,9 @@ void test_activity__init_history(void) {
fake_system_task_callbacks_invoke_pending();
// Feed in 100 steps/min over 1 min, 1 minute of deep and 1 minute of light sleep
prv_feed_cannned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
// Put in a stepping activity
time_t day_start = time_util_get_midnight_of(rtc_get_time());
@ -1095,7 +1095,7 @@ void test_activity__init_history(void) {
// Wait long enough for our recompute sleep and periodic update logic to run.
uint32_t wait_min = MAX(ACTIVITY_SESSION_UPDATE_MIN, ACTIVITY_SETTINGS_UPDATE_MIN);
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * wait_min, 0, ActivitySleepStateAwake);
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * wait_min, 0, ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricStepCount,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){100, 0, 0, 0, 0, 0, 0}));
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricSleepTotalSeconds,
@ -1251,12 +1251,12 @@ void test_activity__day_rollover(void) {
fake_system_task_callbacks_invoke_pending();
// Feed in 100 steps/min over 1 min, 1 minute of deep and 1 minute of light sleep
prv_feed_cannned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
// Wait long enough for our recompute sleep logic to run.
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricStepCount,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){100, 0, 0, 0, 0, 0, 0}));
@ -1313,7 +1313,7 @@ void test_activity__day_rollover(void) {
// Wait long enough for our midnight rollover to occur. We init time at 5pm, so we need to wait
// for at least 7 hours.
const int minutes_till_midnight = (7 * MINUTES_PER_HOUR) - ACTIVITY_SESSION_UPDATE_MIN - 3;
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * (minutes_till_midnight + 1), 0,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * (minutes_till_midnight + 1), 0,
ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricStepCount,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){0, 100, 0, 0, 0, 0, 0}));
@ -1389,7 +1389,7 @@ void test_activity__step_derived_metrics(void) {
cl_assert_equal_i(health_service_sum_today(HealthMetricRestingKCalories), value);
// Feed in 100 steps/minute over 1 hour (walking rate)
prv_feed_cannned_accel_data(SECONDS_PER_HOUR, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(SECONDS_PER_HOUR, 100, ActivitySleepStateAwake);
const int k_exp_steps = 100 * MINUTES_PER_HOUR;
// Test the derived metrics
@ -1415,10 +1415,10 @@ void test_activity__step_derived_metrics(void) {
// Test that ActivityMetricStepMinutes responds correctly
prv_feed_cannned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(1 * SECONDS_PER_MINUTE, 10, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(1 * SECONDS_PER_MINUTE, 10, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_MINUTE, 10, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_MINUTE, 10, ActivitySleepStateAwake);
activity_get_metric(ActivityMetricActiveSeconds, 1, &value);
cl_assert_equal_i(value, SECONDS_PER_HOUR + (2 * SECONDS_PER_MINUTE));
cl_assert_equal_i(health_service_sum_today(HealthMetricActiveSeconds),
@ -1455,7 +1455,7 @@ void test_activity__step_derived_metrics(void) {
ACTIVITY_CALORIES_PER_KCAL));
// Feed in 125 steps/minute over 60 minutes
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 125, ActivitySleepStateAwake);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 125, ActivitySleepStateAwake);
const int k_exp_steps_2 = 125 * MINUTES_PER_HOUR;
// Test the derived metrics
@ -1492,27 +1492,27 @@ void test_activity__sleep_derived_metrics(void) {
// at 10pm, takes 30 minutes to fall asleep, and wakes up at 6am.
// Light walking, 50 steps/minute, until 10pm
prv_feed_cannned_accel_data(5 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(5 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// Falling asleep for 30 minutes
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
// Starting at 10:30pm: 2 Cycles of light (60 min), deep (50 min), awake (10 min)
for (int i = 0; i < 2; i++) {
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
activity_get_metric(ActivityMetricSleepState, 1, &value);
cl_assert_equal_i(value, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
activity_get_metric(ActivityMetricSleepState, 1, &value);
cl_assert_equal_i(value, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(10 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(10 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
}
// 30 minute "morning walk" 4 hours later at 2:30am
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 50, ActivitySleepStateAwake);
activity_get_metric(ActivityMetricSleepState, 1, &value);
cl_assert_equal_i(value, ActivitySleepStateAwake);
cl_assert_equal_i(health_service_peek_current_activities(), HealthActivityNone);
@ -1555,22 +1555,22 @@ void test_activity__sleep_history(void) {
// All of our tests start at 5pm. Let's enter a sleep cycle where the user has a sleep session
// before the cut-off for the new day
// Light walking, 50 steps/minute, until 6pm
prv_feed_cannned_accel_data(1 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// 2.5 hours of sleep, put's us at 8:30pm. The cut-off for the next day is
// ACTIVITY_LAST_SLEEP_MINUTE_OF_DAY, currently set for 9pm so this session should be
// registered for today
prv_feed_cannned_accel_data(150 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(150 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
// Awake for 30 minutes which puts us at 9pm.
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
// Another 2 hour sleep session starting at 9pm. This will leave us at 11pm. Since this
// session ends after the the cutoff, it should be registered for the next day
prv_feed_cannned_accel_data(120 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
// session ends after the cutoff, it should be registered for the next day
prv_feed_canned_accel_data(120 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
// Awake for 2 hours which puts us at 1am
prv_feed_cannned_accel_data(120 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(120 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
// Now if we get sleep history, we should have 2.5 hours yesterday, and 2 hours today
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricSleepTotalSeconds,
@ -1578,10 +1578,10 @@ void test_activity__sleep_history(void) {
150 * SECONDS_PER_MINUTE}));
// Another 2 hour sleep session starting at 1am. This will leave us at 3am.
prv_feed_cannned_accel_data(120 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(120 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
// Awake for 1 hour which puts us at 4am
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricSleepTotalSeconds,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){240 * SECONDS_PER_MINUTE,
@ -1684,22 +1684,22 @@ void test_activity__get_sleep_sessions(void) {
fake_system_task_callbacks_invoke_pending();
// Light walking, 50 steps/minute, until 10pm
prv_feed_cannned_accel_data(5 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(5 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// Falling asleep for 30 minutes
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
// Starting at 10:30pm: 2 Cycles of light (60 min), deep (50 min), awake (10 min)
for (int i = 0; i < 2; i++) {
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(10 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(10 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
}
// 30 minute "morning walk" 4 hours later at 2:30am
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 50, ActivitySleepStateAwake);
activity_get_metric(ActivityMetricSleepState, 1, &value);
cl_assert_equal_i(value, ActivitySleepStateAwake);
@ -1793,10 +1793,10 @@ static uint16_t prv_step_avg_slot(int hour, int min) {
// feed in for the given 15-minute time slot
int prv_expected_steps_per_min(int slot, int multiplier) {
if (multiplier == 1) {
// The slot % 50 was chosen so that the total # of steps per day does not exceeed 2^16
// The slot % 50 was chosen so that the total # of steps per day does not exceed 2^16
return ((slot % 50) + 1);
} else if (multiplier == 2) {
// The slot % 30 was chosen so that the total # of steps per day does not exceeed 2^16
// The slot % 30 was chosen so that the total # of steps per day does not exceed 2^16
return 2 * ((slot % 30) + 1);
} else {
cl_assert(false);
@ -1842,36 +1842,36 @@ static void prv_save_known_settings_file(const char *filename) {
fake_system_task_callbacks_invoke_pending();
// Feed in 100 steps/min over 1 min, 1 minute of deep and 1 minute of light sleep
prv_feed_cannned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(60, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(60, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(60, 0, ActivitySleepStateLightSleep);
// Wait long enough for our recompute sleep logic to run.
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
ActivitySleepStateAwake);
// Advance to next day
prv_feed_cannned_accel_data(SECONDS_PER_HOUR * 24, 0, ActivitySleepStateAwake);
prv_feed_canned_accel_data(SECONDS_PER_HOUR * 24, 0, ActivitySleepStateAwake);
// Feed in 100 steps/min over 2 min, 2 minute of deep and 2 minute of light sleep
prv_feed_cannned_accel_data(120, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(120, 0, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(120, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(120, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(120, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(120, 0, ActivitySleepStateLightSleep);
// Wait long enough for our recompute sleep logic to run.
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
ActivitySleepStateAwake);
// Advance to next day
prv_feed_cannned_accel_data(SECONDS_PER_HOUR * 24, 0, ActivitySleepStateAwake);
prv_feed_canned_accel_data(SECONDS_PER_HOUR * 24, 0, ActivitySleepStateAwake);
// Feed in 100 steps/min over 3 min, 3 minute of deep and 3 minute of light sleep
prv_feed_cannned_accel_data(180, 100, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(180, 0, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(180, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(180, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(180, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(180, 0, ActivitySleepStateLightSleep);
// Wait long enough for our recompute sleep logic to run.
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 0,
ActivitySleepStateAwake);
// Make sure they are what we expected
@ -1985,7 +1985,7 @@ void test_activity__health_events(void) {
// Test that we receive step update events
fake_event_reset_count();
// Feed in 100 steps/minute over 1 minute. We should get some step update events
prv_feed_cannned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(1 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
uint32_t event_count = fake_event_get_count();
// Our fake algorithm generates a step update once a second
@ -2000,23 +2000,23 @@ void test_activity__health_events(void) {
prv_reset_captured_dls_data();
// Falling asleep for 30 minutes
prv_feed_cannned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
prv_feed_canned_accel_data(30 * SECONDS_PER_MINUTE, 5, ActivitySleepStateAwake);
// Starting at 10:31pm: 1 Cycle of light (60 min), deep (50 min)
fake_event_reset_count();
fake_event_set_callback(prv_fake_sleep_event_cb);
s_captured_sleep_event = (PebbleEvent) { };
s_num_captured_sleep_events = 0;
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_cannned_accel_data(15 * SECONDS_PER_MINUTE, 0, ActivitySleepStateAwake);
prv_feed_canned_accel_data(15 * SECONDS_PER_MINUTE, 0, ActivitySleepStateAwake);
prv_feed_cannned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
prv_feed_canned_accel_data(60 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(50 * SECONDS_PER_MINUTE, 0, ActivitySleepStateRestfulSleep);
// Wait long enough for our recompute sleep logic to run.
prv_feed_cannned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 60,
prv_feed_canned_accel_data(SECONDS_PER_MINUTE * ACTIVITY_SESSION_UPDATE_MIN, 60,
ActivitySleepStateAwake);
// See if we got the expected sleep events
@ -2039,7 +2039,7 @@ void test_activity__health_events(void) {
// Wait long enough for a midnight rollover. All tests start at 5pm, so if we wait
// 7 hours, we should get a midnight rollover
prv_feed_cannned_accel_data(7 * SECONDS_PER_HOUR, 0, ActivitySleepStateAwake);
prv_feed_canned_accel_data(7 * SECONDS_PER_HOUR, 0, ActivitySleepStateAwake);
// See if we got the expected history events
cl_assert_equal_i(s_num_captured_history_events, 1);
@ -2071,7 +2071,7 @@ void test_activity__sleep_after_timezone_change(void) {
fake_system_task_callbacks_invoke_pending();
// Advance to 6pm EST
prv_feed_cannned_accel_data(6 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(6 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// switch into PST (which would be 3pm)
tz_info = (TimezoneInfo) {
@ -2081,13 +2081,13 @@ void test_activity__sleep_after_timezone_change(void) {
time_util_update_timezone(&tz_info);
// Walk some more until 11pm PST
prv_feed_cannned_accel_data(8 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(8 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// Starting at 11pm: 2 Cycles of 3 hrs each light (165 min), awake (15 min)
for (int i = 0; i < 2; i++) {
prv_feed_cannned_accel_data(165 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(165 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(15 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(15 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
}
activity_get_metric(ActivityMetricSleepEnterAtSeconds, 1, &value);
@ -2107,7 +2107,7 @@ void test_activity__sleep_after_timezone_change(void) {
// The previous test left us at 5am PST. Let's try going the other way and switch from PST to
// EST right before we fall asleep
// Advance to 11pm PST
prv_feed_cannned_accel_data(18 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
prv_feed_canned_accel_data(18 * SECONDS_PER_HOUR, 50, ActivitySleepStateAwake);
// It is now 11pm PST. Switch to EST, which would be 2am
tz_info = (TimezoneInfo) {
@ -2118,9 +2118,9 @@ void test_activity__sleep_after_timezone_change(void) {
// Starting at 2am EST: 2 Cycles of 3 hrs each light (165 min), awake (15 min)
for (int i = 0; i < 2; i++) {
prv_feed_cannned_accel_data(165 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_canned_accel_data(165 * SECONDS_PER_MINUTE, 0, ActivitySleepStateLightSleep);
prv_feed_cannned_accel_data(15 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
prv_feed_canned_accel_data(15 * SECONDS_PER_MINUTE, 20, ActivitySleepStateAwake);
}
activity_get_metric(ActivityMetricSleepEnterAtSeconds, 1, &value);
@ -2155,17 +2155,17 @@ void test_activity__health_service_interpolation(void) {
fake_system_task_callbacks_invoke_pending();
// Feed in 100 steps/min over 10 minutes, for a total of 1000 steps for today
prv_feed_cannned_accel_data(10 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(10 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
// Wait long enough until we start the next day (15 hours)
prv_feed_cannned_accel_data(SECONDS_PER_HOUR * 15, 0,
prv_feed_canned_accel_data(SECONDS_PER_HOUR * 15, 0,
ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricStepCount,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){0, 1000, 0, 0, 0, 0, 0}));
// Feed in 100 steps/min over 20 minutes, for a total of 2000 steps for today
prv_feed_cannned_accel_data(20 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
prv_feed_canned_accel_data(20 * SECONDS_PER_MINUTE, 100, ActivitySleepStateAwake);
ASSERT_EQUAL_METRIC_HISTORY(ActivityMetricStepCount,
((const uint32_t [ACTIVITY_HISTORY_DAYS]){2000, 1000, 0, 0, 0, 0, 0}));
@ -2265,7 +2265,7 @@ void test_activity__distance(void) {
int exp_distance_m = ROUND(params->exp_distance_m * k_elapsed_sec, params->seconds);
// Feed in the test cadence for the given amount of time
prv_feed_cannned_accel_data(k_elapsed_sec, steps_per_minute, ActivitySleepStateAwake);
prv_feed_canned_accel_data(k_elapsed_sec, steps_per_minute, ActivitySleepStateAwake);
activity_get_metric(ActivityMetricStepCount, 1, &value);
cl_assert_near(value, ROUND(steps_per_minute * k_elapsed_sec, SECONDS_PER_MINUTE), 5);

View file

@ -2017,7 +2017,7 @@ static void prv_feed_activity_minutes(KAlgTestActivityMinute *samples, int sampl
}
// ---------------------------------------------------------------------------------------
// Test that we correectly recognize walk and run activities
// Test that we correctly recognize walk and run activities
void test_kraepelin_algorithm__walks_and_runs(void) {
const int k_minute_data_len = 60;
const int k_minute_data_bytes = k_minute_data_len * sizeof(KAlgTestActivityMinute);

View file

@ -37,7 +37,7 @@ static Uuid test_uuid = (Uuid){0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF};
// A minimal, basic test that heartbeats don't overwrite adjacent data when
// fields next to eachother are set. We set UUID first (well, create_app does),
// fields next to each other are set. We set UUID first (well, create_app does),
// and then set the fields on either side, and verify that UUID remains
// unchanged.
// struct AppHeartbeat {

View file

@ -250,7 +250,7 @@ void test_health_db__movement_data(void) {
cl_assert_equal_i(s_metric_updated_count, NUM_CURRENT_MOVEMENT_METRICS);
// check typicals (not stored)
// check typical (not stored)
int32_t val_out;
cl_assert(!health_db_get_typical_value(ActivityMetricStepCount, Monday, &val_out));
@ -272,7 +272,7 @@ void test_health_db__sleep_data(void) {
cl_assert_equal_i(s_metric_updated_count, NUM_CURRENT_SLEEP_METRICS);
// check typicals
// check typical
int32_t val_out;
cl_assert(health_db_get_typical_value(ActivityMetricSleepTotalSeconds, Monday, &val_out));
@ -296,7 +296,7 @@ void test_health_db__hr_zone_data(void) {
cl_assert_equal_i(s_metric_updated_count, NUM_CURRENT_HR_ZONE_METRICS);
// check typicals (not stored)
// check typical (not stored)
int32_t val_out;
cl_assert(!health_db_get_typical_value(ActivityMetricHeartRateZone1Minutes, Monday, &val_out));

View file

@ -266,7 +266,7 @@ void test_reminder_db__delete_parent(void) {
prv_insert_default_reminders();
const TimelineItemId *parent_id = &item1.header.parent_id;
// cnfirm the two are here
// confirm the two are here
cl_assert(reminder_db_get_len((uint8_t *)&item1.header.id, sizeof(Uuid)) > 0);
cl_assert(reminder_db_get_len((uint8_t *)&item2.header.id, sizeof(Uuid)) > 0);
// remove the two that share a parent
@ -283,7 +283,7 @@ void test_reminder_db__bad_item(void) {
cl_assert(S_SUCCESS != reminder_db_insert((uint8_t *)&bad_item.common.id, UUID_SIZE, (uint8_t *)&bad_item, sizeof(bad_item)));
}
void test_reminder_db__read_nonexistant(void) {
void test_reminder_db__read_nonexistent(void) {
TimelineItem item = {{{0}}};
cl_assert_equal_i(E_DOES_NOT_EXIST, reminder_db_read_item(&item, &bad_item.common.id));
}
@ -301,7 +301,7 @@ void test_reminder_db__find_by_timestamp_title(void) {
cl_assert_equal_b(reminder_db_find_by_timestamp_title(0, "nonexistent title", NULL, &reminder),
false);
// Test matching timstamp, but not title
// Test matching timestamp, but not title
cl_assert_equal_b(reminder_db_find_by_timestamp_title(title_item1.header.timestamp,
"nonexistent title", NULL, &reminder), false);

View file

@ -380,7 +380,7 @@ void test_ble_hrm__grant_after_disconnection(void) {
// Fake disconnection:
s_connections[0] = NULL;
// Grabt permission after disconnection.
// Grab permission after disconnection.
// Request object should be freed and thing shouldn't crash.
prv_assert_permissions_ui_and_respond(true /* is_granted */);

View file

@ -337,7 +337,7 @@ void test_bluetooth_persistent_storage__ble_store_and_get(void) {
cl_assert_equal_m(&irk_out, &pairing_2.irk, sizeof(irk_out));
cl_assert_equal_m(&device_out, &pairing_2.identity, sizeof(device_out));
// Add a thrid pairing
// Add a third pairing
SMPairingInfo pairing_3;
memset(&pairing_3, 0x00, sizeof(pairing_3));
pairing_3 = (SMPairingInfo) {
@ -726,7 +726,7 @@ void test_bluetooth_persistent_storage__bt_classic_store_and_get(void) {
cl_assert_equal_s(name_2, name_out);
cl_assert_equal_i(platform_bits_2, platform_bits_out);
// Add a thrid pairing
// Add a third pairing
BTDeviceAddress addr_3 = {{0x31, 0x32, 0x33, 0x34, 0x35, 0x36}};
SM128BitKey link_key_3 = {{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}};

View file

@ -440,7 +440,7 @@ void test_bluetooth_persistent_storage_prf__bt_classic_store_and_get(void) {
cl_assert_equal_s(name_2, name_out);
cl_assert_equal_i(platform_bits_2, platform_bits_out);
// Add a thrid pairing
// Add a third pairing
BTDeviceAddress addr_3 = {.octets = {0x31, 0x32, 0x33, 0x34, 0x35, 0x36}};
SM128BitKey link_key_3 = {
.data = {

View file

@ -256,7 +256,7 @@ void test_session__last_system_session_wins(void) {
comm_session_close(system_session2, CommSessionCloseReason_UnderlyingDisconnection);
// The transport's .close is supposed to call this.
// The stub in this test doens't, so clean up manually:
// The stub in this test doesn't, so clean up manually:
comm_session_close(system_session, CommSessionCloseReason_UnderlyingDisconnection);
}

View file

@ -141,7 +141,7 @@ static void prv_set_connection_responsiveness(Transport *transport,
}
// Referenced from protocol_endppints_table.auto.h override header:
// Referenced from protocol_endpoints_table.auto.h override header:
///////////////////////////////////////////////////////////
typedef enum {

View file

@ -276,7 +276,7 @@ void test_compositor__app_render_busy(void) {
compositor_app_render_ready();
cl_assert_equal_i(s_count_display_update, 0);
// Now fake the display update completeing. The app should know draw.
// Now fake the display update completing. The app should know draw.
s_display_update_in_progress = false;
prv_handle_display_update_complete();
cl_assert_equal_i(s_count_display_update, 1);

View file

@ -500,7 +500,7 @@ void test_health__range_to_day_id_clamps_values(void) {
}
void test_health__sum_full_days(void) {
// use values structured as binary mask so we can detect if we sum up currect days
// use values structured as binary mask so we can detect if we sum up correct days
s_sys_activity_get_metric_values.out.history[0] = 1000;
s_sys_activity_get_metric_values.out.history[1] = 2000;
s_sys_activity_get_metric_values.out.history[2] = 4000;
@ -606,7 +606,7 @@ void test_health__process_range(void) {
}
void test_health__sum_fraction_days(void) {
// use values structured as binary mask so we can detect if we sum up currect days
// use values structured as binary mask so we can detect if we sum up correct days
s_sys_activity_get_metric_values.out.history[0] = 1000;
s_sys_activity_get_metric_values.out.history[1] = 2000;
s_sys_activity_get_metric_values.out.history[2] = 4000;
@ -1308,7 +1308,7 @@ void test_health__avg_full_days(void) {
time_util_get_midnight_of(now), HealthServiceTimeScopeDaily);
cl_assert_equal_i(result, exp_daily);
// All of our tests set "now" to Mon, 28 Dec 2015 09:12:22 GMT, so yesteday was a Sunday
// All of our tests set "now" to Mon, 28 Dec 2015 09:12:22 GMT, so yesterday was a Sunday
result = health_service_sum_averaged(HealthMetricStepCount,
time_util_get_midnight_of(now) - SECONDS_PER_DAY,
time_util_get_midnight_of(now),
@ -1434,7 +1434,7 @@ void test_health__avg_partial_days(void) {
// ---
// Compute weekend HealthMetricActiveSeconds average from 4am to 9am. This should use the
// daily totals since we don't havce 15-minute averages maintained for this metric
// daily totals since we don't have 15-minute averages maintained for this metric
exp_value = (k_daily_total * 5 * MINUTES_PER_HOUR) / MINUTES_PER_DAY;
// Since "today" is Monday, going back 24 hours puts us on a weekend
@ -1532,17 +1532,17 @@ static void prv_update_stats(HealthServiceStats *stats, HealthValue value) {
// valid aggregation functions. The sum function is only applicable to cumulative metrics and is
// tested above in test_health__sum_full_days().
// DISBLAED because the firmware doesn't actually store daily history of HRM values.
// DISABLED because the firmware doesn't actually store daily history of HRM values.
void DISABLED_test_health__min_max_avg_full_days(void) {
// Get the current time and day
const time_t now = rtc_get_time();
const time_t yeserday_utc = now - SECONDS_PER_DAY;
const time_t yesterday_utc = now - SECONDS_PER_DAY;
struct tm local_tm;
localtime_r(&now, &local_tm);
DayInWeek todays_day_in_week = local_tm.tm_wday;
localtime_r(&yeserday_utc, &local_tm);
localtime_r(&yesterday_utc, &local_tm);
DayInWeek yesterday_day_in_week = local_tm.tm_wday;
bool yesterday_was_weekend = (yesterday_day_in_week == Sunday)
|| (yesterday_day_in_week == Saturday);

View file

@ -127,7 +127,7 @@ void test_ancs_filtering__record_app_no_action_needed(void) {
}
void test_ancs_filtering__record_app_no_prefs_yet(void) {
// No existing prefs yet, we should instert all the defaults
// No existing prefs yet, we should insert all the defaults
iOSNotifPrefs *existing_prefs = NULL;
AttributeList attr_list = {

View file

@ -142,7 +142,7 @@ void test_ancs_notifications__handle_phone_call_message(void) {
ancs_notifications_handle_message(37, properties, notif_attributes, app_attributes);
// We just processed an incomming phone call event, there better be a phone event scheduled!
// We just processed an incoming phone call event, there better be a phone event scheduled!
PebbleEvent event = fake_event_get_last();
cl_assert_equal_i(event.type, PEBBLE_PHONE_EVENT);

View file

@ -68,7 +68,7 @@ void test_nexmo__initialize(void) {
void test_nexmo__cleanup(void) {
}
void test_nexmo__is_reuath_sms(void) {
void test_nexmo__is_reauth_sms(void) {
uint8_t expected_app_id_buf[128];
ANCSAttribute *expected_app_id = (ANCSAttribute *)&expected_app_id_buf;
expected_app_id->length = strlen(IOS_SMS_APP_ID);
@ -103,7 +103,7 @@ void test_nexmo__is_reuath_sms(void) {
cl_assert(!nexmo_is_reauth_sms(bad_app_id, bad_message));
}
void test_nexmo__handle_reuath_sms(void) {
void test_nexmo__handle_reauth_sms(void) {
// UID
const uint32_t uid = 42;
s_expected_uid = uid;

View file

@ -690,7 +690,7 @@ void test_protobuf_log__measurements_auto_flush(void) {
values[i] = i * 3;
}
// Create a session with an artifically small buffer size which will cause it to flush
// Create a session with an artificially small buffer size which will cause it to flush
// automatically
time_t start_time = rtc_get_time();
ProtobufLogConfig log_config = {

View file

@ -107,7 +107,7 @@ static void set_and_verify(SettingsFile *file, uint8_t *key, int key_len,
}
void test_settings_file__set_get_one(void) {
printf("\nTesting setting and retreiving a single key a single time...\n");
printf("\nTesting setting and retrieving a single key a single time...\n");
SettingsFile file;
cl_must_pass(settings_file_open(&file, "test_file_set_get_one", 4096));
uint8_t key[4];
@ -121,7 +121,7 @@ void test_settings_file__set_get_one(void) {
}
void test_settings_file__set_get_one_many_times(void) {
printf("\nTesting setting and retreiving a key several times...\n");
printf("\nTesting setting and retrieving a key several times...\n");
SettingsFile file;
cl_must_pass(settings_file_open(&file, "test_file_set_get_one_many_times", 4096));
uint8_t key[4];
@ -320,7 +320,7 @@ void test_settings_file__used_space_tracking(void) {
set_and_verify(&file, key, key_len, val, val_len);
}
// Then, write to the same key many many times. This should only use up 16
// Then, write to the same key many, many, times. This should only use up 16
// more bytes of the file if our used/free space tracking is working
// correctly, but may end up being counted as more if it's broken.
snprintf((char *)key, sizeof(key), "k%03d", 128);
@ -405,7 +405,7 @@ static RecordResult write_and_change_record_aborting_after_bytes(int after_n_byt
return RecordResultNew;
}
// Should not get here! This means that neither the old nor the new value
// could be retreived, and thus the atomicity is broken! Aaaaaaaaaaaaaah!!
// could be retrieved, and thus the atomicity is broken! Aaaaaaaaaaaaaah!!
cl_assert(false);
}
fake_spi_flash_force_future_failure(after_n_bytes, &jmp);

View file

@ -321,7 +321,7 @@ void test_do_not_disturb__disabling_manual_dnd_should_override_scheduled(void) {
active = do_not_disturb_is_active();
cl_assert(active == true); // Both OFF
do_not_disturb_set_manually_enabled(false); // turned Manual OFF, scheduled should be overriden
do_not_disturb_set_manually_enabled(false); // turned Manual OFF, scheduled should be overridden
cl_assert(do_not_disturb_is_manually_enabled() == false);
cl_assert(do_not_disturb_is_schedule_enabled(WeekdaySchedule) == true);
active = do_not_disturb_is_active();

View file

@ -217,7 +217,7 @@ void test_hrm_manager__subscription(void) {
cl_assert_equal_b(hrm_is_enabled(HRM), false);
}
// When we cleanup after an app process, its subscription, if any, should get an expriration time
// When we cleanup after an app process, its subscription, if any, should get an expiration time
// placed on it
void test_hrm_manager__app_cleanup(void) {
stub_pebble_tasks_set_current(PebbleTask_App);

View file

@ -296,19 +296,19 @@ void test_music_endpoint__receive_zero_length_now_playing(void) {
cl_assert_equal_b(music_has_now_playing(), false);
}
void test_music_endpoint__ignore_malformatted_messages(void) {
void test_music_endpoint__ignore_malformed_messages(void) {
// Android app connects:
prv_receive_app_info_event(true /* is_android */);
const uint8_t malformatted_artist[] = {
const uint8_t malformed_artist[] = {
0x10, 14, 'o', 'n', 'e', 3, 't', 'w', 'o', 5, 't', 'h', 'r', 'e', 'e'
};
const uint8_t malformatted_album[] = {
const uint8_t malformed_album[] = {
0x10, 3, 'o', 'n', 'e', 10, 't', 'w', 'o', 5, 't', 'h', 'r', 'e', 'e'
};
const uint8_t malformatted_title[] = {
const uint8_t malformed_title[] = {
0x10, 3, 'o', 'n', 'e', 3, 't', 'w', 'o', 6, 't', 'h', 'r', 'e', 'e'
};
const uint8_t malformatted_player[] = {
const uint8_t malformed_player[] = {
0x13, 17, 'c', 'o', 'm', '.', 's', 'p', 'o', 't', 'i', 'f', 'y', '.', 'm', 'u', 's', 'i', 'c',
9, 'S', 'p', 'o', 't', 'i', 'f', 'y'
};
@ -316,10 +316,10 @@ void test_music_endpoint__ignore_malformatted_messages(void) {
const uint8_t *data;
uint16_t length;
} test_vectors[] = {
{ malformatted_artist, sizeof(malformatted_artist) },
{ malformatted_album, sizeof(malformatted_album) },
{ malformatted_title, sizeof(malformatted_title) },
{ malformatted_player, sizeof(malformatted_player) }
{ malformed_artist, sizeof(malformed_artist) },
{ malformed_album, sizeof(malformed_album) },
{ malformed_title, sizeof(malformed_title) },
{ malformed_player, sizeof(malformed_player) }
};
for (int i = 0; i < ARRAY_LENGTH(test_vectors); ++i) {
prv_receive_pp_data(test_vectors[i].data, test_vectors[i].length);

View file

@ -671,7 +671,7 @@ void test_pfs__migration(void) {
pfs_init(true);
ftl_force_version(1);
// simulate a migration by leaving leaving files in various states
// simulate a migration by leaving files in various states
// in the first region. Then try to add another region and confirm
// none of the files have been corrupted
char file_small[10];
@ -930,7 +930,7 @@ void test_pfs__start_page_collides_with_gc_page(void) {
test_force_recalc_of_gc_region();
pfs_init(false);
int expected_remaing_files = pages_per_sector - 1;
int expected_remaining_files = pages_per_sector - 1;
// scatter files across two sectors
for (int i = 0; i < (pages_per_sector + start_page_offset); i++) {
@ -941,14 +941,14 @@ void test_pfs__start_page_collides_with_gc_page(void) {
pfs_close(fd);
// delete some files in the region so a garbage collection will do something
if (i >= expected_remaing_files) {
if (i >= expected_remaining_files) {
pfs_remove(filename);
}
}
test_force_garbage_collection(pages_per_sector);
for (int i = 0; i < expected_remaing_files; i++) {
for (int i = 0; i < expected_remaining_files; i++) {
char filename[20];
sprintf(filename, "test%d", i + start_page_offset);
int fd = pfs_open(filename, OP_FLAG_READ, FILE_TYPE_STATIC, 10);

View file

@ -424,7 +424,7 @@ void test_shared_prf_storage_v3__write_in_loop_getting_started_confirm_data_stil
}
// Sets the getting started field, then corrupts the getting_started crc
void test_shared_prf_storage_v3__handle_currupt_field_same(void) {
void test_shared_prf_storage_v3__handle_corrupt_field_same(void) {
bool GETTING_STARTED_COMPLETE = true;
shared_prf_storage_set_getting_started_complete(GETTING_STARTED_COMPLETE);
cl_assert_equal_i(shared_prf_storage_get_valid_page_number(), 0);
@ -470,7 +470,7 @@ void test_shared_prf_storage_v3__handle_currupt_field_same(void) {
// Sets the getting started field, then corrupts the ble_pairing_data crc
// This tests that when setting a value, all fields in the struct must be valid.
void test_shared_prf_storage_v3__handle_currupt_field_during_setting(void) {
void test_shared_prf_storage_v3__handle_corrupt_field_during_setting(void) {
bool GETTING_STARTED_COMPLETE = true;
shared_prf_storage_set_getting_started_complete(GETTING_STARTED_COMPLETE);
cl_assert_equal_i(shared_prf_storage_get_valid_page_number(), 0);

View file

@ -147,7 +147,7 @@ void test_smartstrap_comms__send_receive_data(void) {
// faked on-the-wire data for response
uint8_t response_raw[] = {0x7E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x43, 0x7E};
// send the rquest
// send the request
prv_do_send(&write_mbuf, &read_mbuf, expected, sizeof(expected));
// process the fake response
prv_do_read(response_raw, sizeof(response_raw), &read_mbuf, test_data, sizeof(test_data));

View file

@ -46,7 +46,7 @@ void test_timezone_database__get_region_count(void) {
}
void test_timezone_database__find_region_by_name_simple(void) {
// Unforunately we don't really care what the resulting region ids are, we should
// Unfortunately we don't really care what the resulting region ids are, we should
// just make sure the ones that exist are there and they're unique from each other.
const int america_new_york_region = FIND_REGION("America/New_York");

View file

@ -506,7 +506,7 @@ void test_voice_endpoint__handle_nlp_result(void) {
cl_assert_equal_i(s_session_result, VoiceEndpointResultSuccess);
cl_assert_equal_i(s_session_id, 0x2211);
// test non nexistent timestamp msg
// test nonexistent timestamp msg
nlp_result[8] = 1;
s_session_id = 0;
voice_endpoint_protocol_msg_callback(NULL, nlp_result, sizeof(nlp_result) - 7);

View file

@ -741,7 +741,7 @@ void test_timeline_peek_event__one_persistent_event_lifecycle(void) {
CHECK_NO_EVENTS( .count = 6, .is_future_empty = true );
}
void test_timeline_peek_event__upcoming_priotized_over_persistent_event_lifecycle(void) {
void test_timeline_peek_event__upcoming_prioritized_over_persistent_event_lifecycle(void) {
TimelineItem item =
DEFINE_EVENT( .id = 0x01, .timestamp = 20 * SECONDS_PER_MINUTE, .duration = 70,
.persistent = true );

View file

@ -148,7 +148,7 @@ void test_flash_region__erase_optimal_range_96k_app_banks(void) {
s_command_list_index = 0;
// App that's in an aligned bank but larger than than 64k
// App that's in an aligned bank but larger than 64k
flash_region_erase_optimal_range(0, 0, 69 * 1024, 96 * 1024);
cl_assert_equal_i(s_command_list_index, 3);
@ -185,7 +185,7 @@ void test_flash_region__erase_optimal_range_96k_app_banks(void) {
s_command_list_index = 0;
// App that's in an unaligned bank but larger than than 64k
// App that's in an unaligned bank but larger than 64k
flash_region_erase_optimal_range(32 * 1024, 32 * 1024, (32 + 71) * 1024, (32 + 96) * 1024);
cl_assert_equal_i(s_command_list_index, 9);

View file

@ -114,7 +114,7 @@ static int s_current_day = 0;
static const int s_thursday = 1426118400;
// Friday March 13, 2015, 00:00 UTC
static const int s_friday = 1426204800;
// Saturaday March 14, 2015, 00:00 UTC
// Saturday March 14, 2015, 00:00 UTC
static const int s_saturday = 1426291200;
// Sunday March 15, 2015, 00:00 UTC
static const int s_sunday = 1426377600;

View file

@ -206,7 +206,7 @@ void test_app_run_state__send_update(void) {
}
void test_app_run_state__protocol_msg_callback(void) {
// Tests app_run_state_procotol_msg_callback which should take data
// Tests app_run_state_protocol_msg_callback which should take data
// from a source and perform the appropriate command
prv_set_remote_active();
prv_set_remote_capability(CommSessionRunState);

View file

@ -39,7 +39,7 @@ void test_debug_db__initialize(void) {
void test_debug_db__cleanup(void) {
}
void test_debug_db__unitialized(void) {
void test_debug_db__uninitialized(void) {
int index;
uint8_t id;

View file

@ -234,7 +234,7 @@ void test_heap___heap_bytes_free(void) {
int after_available = heap_bytes_free();
// make sure the two values are within 16 bytes (usually shoule be 0-8, but 16 for safety)
// make sure the two values are within 16 bytes (usually should be 0-8, but 16 for safety)
cl_assert(abs((before_available - malloc_size_bytes) - after_available) < 16);
heap_free(heap, ptr, 0);
@ -263,7 +263,7 @@ void test_heap__heap_bytes_used(void) {
int after_used = heap_bytes_used();
// make sure the two values are within 16 bytes (usually shoule be 0-8, but 16 for safety)
// make sure the two values are within 16 bytes (usually should be 0-8, but 16 for safety)
cl_assert(abs((before_used + malloc_size_bytes) - (after_used)) < 16);
heap_free(heap, ptr, 0);
@ -331,7 +331,7 @@ static void prv_alloc_and_test_fuzz_on_free(bool enabled) {
heap_free(heap, test, 0);
if (enabled) {
// the memory was fuzz'ed, better not match
// the memory was fuzzed, better not match
cl_assert(memcmp(test, test_string, strlen(test_string)) != 0);
} else {
// free'd data should match what was already there

View file

@ -138,7 +138,7 @@ void test_launcher_app_message__cleanup(void) {
fake_system_task_callbacks_cleanup();
}
void test_launcher_app_message__ingore_too_short_message(void) {
void test_launcher_app_message__ignore_too_short_message(void) {
uint8_t too_short = 0;
launcher_app_message_protocol_msg_callback_deprecated(s_session, &too_short, sizeof(too_short));
fake_comm_session_process_send_next();

View file

@ -108,7 +108,7 @@ void test_phone_formatting__overflowing_first_name(void) {
char dest[NAME_LENGTH];
memset(dest, GUARD_CHAR, NAME_LENGTH);
phone_format_caller_name("Pankajavalli Balamarugan", dest, buffer_length);
phone_format_caller_name("Pankajavalli Balamurugan", dest, buffer_length);
cl_assert_equal_s(dest, "Pankajava");
cl_assert_equal_m(dest + buffer_length, GUARD_REFERENCE, NAME_LENGTH - buffer_length);

View file

@ -373,7 +373,7 @@ void test_resource__read_past_last_byte_resource(void) {
size_t image_size = resource_size(resource_bank, no_litter_res_id);
uint8_t image_buf[image_size];
// read the last byte, and make sure it returns a a failure 0 byte return value
// read the last byte, and make sure it returns a failure 0 byte return value
cl_assert_equal_i( resource_load_byte_range_system(resource_bank, no_litter_res_id, image_size,
image_buf, 1), 0);

View file

@ -197,7 +197,7 @@ void test_utf8_iterator__each_codepoint_invalid(void) {
cl_assert_equal_i(s_each_count, 0);
}
void test_utf8_iterator__each_codepoint_emptry_string(void) {
void test_utf8_iterator__each_codepoint_empty_string(void) {
void *context = (void *)(uintptr_t)0x42;
const char *str = "";
s_each_count = 0;

View file

@ -159,7 +159,7 @@ static uint64_t prv_now_ms(void) {
static void prv_advance_by_ms_no_timers(uint64_t ms_delta) {
uint64_t target_ms = prv_now_ms() + ms_delta;
// Comppensate for rounding errors
// Compensate for rounding errors
uint64_t new_ticks = rtc_get_ticks() + (ms_delta * RTC_TICKS_HZ + 500 ) / 1000;
uint64_t new_ms = (new_ticks * 1000 + RTC_TICKS_HZ / 2) / RTC_TICKS_HZ;
if (new_ms == target_ms - 1) {
@ -1126,7 +1126,7 @@ void test_animation__property_gcolor8(void) {
// --------------------------------------------------------------------------------------
// Test that the schedule/unschedule calls work correctly.
// We should be able to unschedule an amimation parthway through
// We should be able to unschedule an animation partway through
void test_animation__unschedule(void) {
#ifdef TEST_INCLUDE_BASIC
PropertyAnimation *prop_h;
@ -3466,7 +3466,7 @@ void test_animation__sequence_of_already_completed(void) {
// --------------------------------------------------------------------------------------
// Test creating a spawn where where some children are already scheduled and some have
// Test creating a spawn where some children are already scheduled and some have
// already completed.
//
// Here's a graph of what we are doing

View file

@ -115,7 +115,7 @@ void test_kino_player__cleanup(void) {
extern void prv_play_animation_update(Animation *animation, const AnimationProgress normalized);
void test_kino_player__finite_animation_finite_reel_foward(void) {
void test_kino_player__finite_animation_finite_reel_forward(void) {
// Choose duration and elapsed to have clean division for
// ANIMATION_NORMALIZED_MAX * elapsed / duration = whole_number
test_reel_data->duration_ms = 300;
@ -127,7 +127,7 @@ void test_kino_player__finite_animation_finite_reel_foward(void) {
cl_assert_equal_i(kino_reel_get_elapsed(test_reel), 20);
}
void test_kino_player__create_finite_animation_finite_reel_foward(void) {
void test_kino_player__create_finite_animation_finite_reel_forward(void) {
// Choose duration and elapsed to have clean division for
// ANIMATION_NORMALIZED_MAX * elapsed / duration = whole_number
test_reel_data->duration_ms = 300;

View file

@ -532,7 +532,7 @@ void test_window_stack__insert_next(void) {
// Description:
// During the push of a window, we push another window in the load handler of
// the window being pushed. This causes the loading window to disappaer from
// the window being pushed. This causes the loading window to disappear from
// the screen (before it even appeared) and become subverted by the new window.
void test_window_stack__push_during_window_load(void) {
Window *window = window_create();

View file

@ -32,7 +32,7 @@ void test_ihex__initialize(void) {
static void prv_assert_ihex(const char *expected) {
int len = strlen(expected);
// Cehck that bytes aren't touched past the end of the record.
// Check that bytes aren't touched past the end of the record.
for (int i=len; i < sizeof(s_result); ++i) {
cl_assert_equal_i(0x20, s_result[i]);
}

View file

@ -99,7 +99,7 @@ void test_mbuf__length(void) {
}
void test_mbuf__iter_empty(void) {
// test iteratoring over empty mbuf chains
// test iterating over empty mbuf chains
MBuf mbuf1 = MBUF_EMPTY;
MBuf mbuf2 = MBUF_EMPTY;
MBufIterator iter;
@ -133,7 +133,7 @@ void test_mbuf__iter_modify(void) {
for (int i = 0; i < 6; i++) {
cl_assert(!mbuf_iterator_is_finished(&write_iter));
cl_assert(!mbuf_iterator_is_finished(&read_iter));
// check we're on the exected mbuf
// check we're on the expected mbuf
if (i < 3) {
cl_assert(mbuf_iterator_get_current_mbuf(&write_iter) == &mbuf1);
cl_assert(mbuf_iterator_get_current_mbuf(&read_iter) == &mbuf1);

View file

@ -21,7 +21,7 @@
// Tests
///////////////////////////////////////////////////////////
void test_mktime__bithdays(void) {
void test_mktime__birthdays(void) {
struct tm francois_birthday = {
.tm_sec = 0,
.tm_min = 44,

View file

@ -601,7 +601,7 @@ void test_sprintf__percent_n(void) {
snprintf(dstbuf, 256, "%n", &val);
cl_assert_equal_i(val, 0);
snprintf(dstbuf, 256, "Incredible mechanical monster%n comming soon%n!!", &val, &val2);
snprintf(dstbuf, 256, "Incredible mechanical monster%n coming soon%n!!", &val, &val2);
cl_assert_equal_i(val, 29);
cl_assert_equal_i(val2, 42);

View file

@ -213,7 +213,7 @@ void test_circular_buffer__read_or_copy_returns_false_when_length_is_too_long(vo
malloc, &caller_should_free));
}
void test_circular_buffer__read_or_copy_doesnt_copy_when_already_continguously_stored(void) {
void test_circular_buffer__read_or_copy_doesnt_copy_when_already_contiguously_stored(void) {
CircularBuffer buffer;
uint8_t storage[8];
circular_buffer_init(&buffer, storage, sizeof(storage));
@ -230,7 +230,7 @@ static void *prv_oom_malloc(size_t length) {
return NULL;
}
void test_circular_buffer__read_or_copy_does_copy_when_not_continguously_stored(void) {
void test_circular_buffer__read_or_copy_does_copy_when_not_contiguously_stored(void) {
CircularBuffer buffer;
uint8_t storage[8];
circular_buffer_init(&buffer, storage, sizeof(storage));

View file

@ -230,7 +230,7 @@ void test_math_fixed__S16_3_rounding(void) {
// This test shows how the in between fractional values evaluate to the fixed representation
// Positive numbers round down to nearest fraction
// Negative numbers round up to neareset fraction
// Negative numbers round up to nearest fraction
test_num = (int16_t)((float)-1.249 * (1 << FIXED_S16_3_PRECISION));
num = (Fixed_S16_3){ .raw_value = test_num };
cl_assert(num.integer == -2);
@ -444,7 +444,7 @@ void test_math_fixed__S32_16_mul(void) {
Fixed_S32_16 num1, num2;
Fixed_S32_16 mul, mul_c;
// Test number muliplication
// Test number multiplication
num1 = FIXED_S32_16_ONE;
num2 = FIXED_S32_16_ONE;
mul = Fixed_S32_16_mul(num1, num2);

View file

@ -109,7 +109,7 @@ void test_string__test_itoa_int(void) {
}
void test_string__test_byte_stream_to_hex_string(void) {
char result_buf[256]; // arbitraily large
char result_buf[256]; // arbitrarily large
const uint8_t byte_stream[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
const char *expected_result_fwd = "00010203040506070809";

View file

@ -30,7 +30,7 @@ test's `clar()` build rule.
files `#include`'ing these files always fail to compile unless
overridden?
- Is using `#ifdef __ARM__` conditional compilation to replace
ARM-specific code with a gneric version insufficient? Would it require
ARM-specific code with a generic version insufficient? Would it require
adding test-harness code to the source tree?
If the answer to any of the above questions is "no", then adding an